Migration Guide 1.2.0

Repositories (Changes)

Renamed

  • com.digitalsubstrate.dbe --> com.digitalsubstrate.cdbe
  • com.digitalsubstrate.qt-dbe --> com.digitalsubstrate.cdbe-qt
  • com.digitalsubstrate.qt-component --> com.digitalsubstrate.component-qt
  • com.digitalsubstrate.qt-ge --> com.digitalsubstrate.ge-qt
  • com.digitalsubstrate.dsm-renderer --> com.digitalsubstrate.viper/kibo
  • com.digitalsubstrate.goodies --> com.digitalsubstrate.viper/dsm_vscode

Deprecated

  • com.digitalsubstrate.dsm-renderer
  • com.digitalsubstrate.goodies

Optionals

  • com.digitalsubstrate.cdbe-qt
  • com.digitalsubstrate.component-qt

Recommended Database Editors are located in com.digitalsubstrate.viper/tools - dbe.py (Database Editor) - cdbe.py (Commit Database Editor)

Tools (New)

Tools are located in com.digitalsubstrate.viper/tools

  • dsm_utils.py
  • commit_admin.py
  • dbe.py
  • cdbe.py
  • kibo-1.2.0.jar
  • service_client

dsm_utils.py (Changes)

sub commands renamed:

  • create_db --> create_database
  • create_commit_db --> create_commit_database
  • create_package --> create_python_package

Database Editor (New)

A document editor for a Database or a DatabaseRepository.

> dbe.py [database_path]`

PySide6 was added to requirements.txt

Commit Database Editor (New)

A document editor for a Commit database_ based on the store application model for commit.

```

cdbe.py [database_path]` ```

WEB CDB Editor (New)

A document editor based on a flask server over a Commit database.

```

cd python/web_cdbe flask run --debug ```

flask was added to requirements.txt - The databases.link must a symbolic to the CommitDatabase to server - Pure HTML5 (no javascript)

C++ Tools (Changes)

  • dsm_tool --> dsm_check
  • commit_server --> commit_database_server
  • repository_server --> database_repository_server

dsviper (Changes)

  • C++ fields and methods are exposed with Python methods.
    • state.getting.commit_id --> state.getting().commit_id()
    • ...
  • global functions where moved to static methods in the appropriate classes.
    • make_uuid(...) --> ValueUUId.create(...)
    • make_blob_id(...) --> ValueBlobId(blob_layout, blob)
    • make_key(...) --> ValueKey.create(...)
    • dsm_assemble(...) --> DSMBuilder.assemble(...)
    • codec_query(...) --> Codec.query(...)
    • ...
  • global constants where moved to class constants
    • TYPE_VOID --> Type.VOID
    • TYPE_FLOAT --> Type.FLOAT
    • CODEC_STREAM_TOKEN_BINARY --> Codec.STREAM_TOKEN_BINARY
    • ...
  • class Type (Base class)
    • class Type: ...
    • class TypeVector(Type): ...
    • T.cast(B) --> T
    • ...
  • class Value (Base class)
    • class Value: ...
    • class ValueFloat(Value): ...
    • V.cast(B) --> V
    • ...
  • Value Constructors
    • ValueUInt8(initial_value=None)
    • ValueVector(type_vector, initial_value=None)
    • ...
    • T.cast(B) --> V
    • T.copy() --> T
    • T.hash() --> int
    • T.try_parse(value: str) --> T | None
  • C++ Enum are str for simplicity
    • StringHelper::str(E e) --> str
  • dsviper raise dsviper.ViperError instead of RuntimeError

Interfaces (New)

  • DocumentGetting to get documents and definitions.
  • BlobGetting to get blob info and data.
  • sharable tools are based on DocumentGetting and/or BlobGetting
    • KeyNamer, KeyHelper, DocumentBuilder,...

ViperError (New)

  • inherit from Exception

Error (New Class)

  • use Error.parse(description: str) -> Error | None
  • Error.explained(self) -> str
  • Error.module -> Error.component

Type (New Class)

  • Type.FLOAT, Type.INT8, ...
  • Type.encode(...)
  • Type.decode(...)
  • Type.use_blob_id(...)

Value (New Class)

  • Value.deduce
  • Value.load
  • Value.dump
  • Value.encode(...),
  • Value.decode(...),
  • Value.json_encode(...)
  • Value.json_decode(...)
  • Value.bson_encode(...)
  • Value.bson_decode(...)
  • Value.fuzz(...),
  • Value.succ(...)
  • Value.collect_blob_ids(...)
  • Value.create(...)
  • Value.copy(...)

UUId (API Changes)

  • ValueUUId.create(...)
  • ValueUUId.INVALID

BlobId (API Changes)

  • ValueBlobId.create(...)
  • ValueBlobId.INVALID

Key (API Changes)

  • ValueKey.create(...)

DSMBuilder (API Changes)

  • DSMBuilder.assemble(...)
  • DSMBuilder.parse(self)

DSMDefinitions (API Changes)

  • DSMDefinitions.encode(self, ...)
  • DSMDefinitions.decode(...)
  • DSMDefinitions.json_encode(self,)
  • DSMDefinitions.json_decode(...)
  • DSMDefinitions.bson_encode(self,...)
  • DSMDefinitions.bson_encode(...)

Definitions(API Changes)

  • Definitions.decode(...)

DefinitionsConst (API Changes)

  • DefinitionsConst.encode(self)
  • DefinitionsConst.inject(self)
  • DefinitionsConst.discard(self)

Blob (New API)

  • ValueBlob.base64_encode(self)
  • ValueBlob.base64_decode(...)

Path (API Changes)

  • API to construct Path
  • Path.from_unwrap()
  • Path.from_field(...)
  • ...
  • fluent API to append component
  • Path.field(self,...)
  • Path.unwrap(self,...)
  • ...
  • Path.decode(...)
  • Path.const(self) -> PathConst

PathConst (New Class)

  • API to consume Path.
    • Path.at(self)
    • Path.set(self,...)
    • ...
  • PathConst.encode(self, ...)

Function Prototype (API Changes)

  • FunctionPrototype.encode(self, ...)
  • FunctionPrototype.decode(...)

CommitStoreBaseNotifying (New Class)

  • CommitStoreBaseNotifying.make(...)

FunctionPool (API Changes)

  • FunctionPool.make_function(self, ...) is removed

Databasing (Changed)

  • Databasing.TRANSACTION_DIFFERED
  • Databasing.TRANSACTION_IMMEDIATE
  • Databasing.TRANSACTION_EXCLUSIVE

HTML (New Class)

  • Html.dsm_definitions(...)
  • Html.value(...)
  • Html.value_pretty(...)
  • Html.type(...)
  • Html.style(...)
  • Html.body(...)
  • Html.documents_details(...)
  • Html.documents_table(...)

Float16 (New Class)

  • Float16.from_float(...)
  • Float16.to_float(...)

Codec (New Class)

  • Codec.STREAM_BINARY
  • Codec.STREAM_TOKEN_BINARY
  • Codec.query(...)
  • Codec.check(...)