@chipmobilesdk/rn-local-db 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +160 -1
- package/README.md +99 -19
- package/lib/commonjs/adapter/budgets.js +79 -0
- package/lib/commonjs/adapter/budgets.js.map +1 -0
- package/lib/commonjs/adapter/collection.js +236 -0
- package/lib/commonjs/adapter/collection.js.map +1 -0
- package/lib/commonjs/adapter/deletion.js +291 -0
- package/lib/commonjs/adapter/deletion.js.map +1 -0
- package/lib/commonjs/adapter/handle.js +259 -0
- package/lib/commonjs/adapter/handle.js.map +1 -0
- package/lib/commonjs/adapter/index.js +67 -0
- package/lib/commonjs/adapter/index.js.map +1 -0
- package/lib/commonjs/adapter/lifecycle.js +176 -0
- package/lib/commonjs/adapter/lifecycle.js.map +1 -0
- package/lib/commonjs/adapter/schema-sync.js +124 -0
- package/lib/commonjs/adapter/schema-sync.js.map +1 -0
- package/lib/commonjs/adapter/transaction.js +58 -0
- package/lib/commonjs/adapter/transaction.js.map +1 -0
- package/lib/commonjs/artifacts/availability.js +90 -0
- package/lib/commonjs/artifacts/availability.js.map +1 -0
- package/lib/commonjs/artifacts/cascade.js +80 -0
- package/lib/commonjs/artifacts/cascade.js.map +1 -0
- package/lib/commonjs/artifacts/paths.js +31 -0
- package/lib/commonjs/artifacts/paths.js.map +1 -0
- package/lib/commonjs/artifacts/reconcile.js +55 -0
- package/lib/commonjs/artifacts/reconcile.js.map +1 -0
- package/lib/commonjs/artifacts/store.js +300 -0
- package/lib/commonjs/artifacts/store.js.map +1 -0
- package/lib/commonjs/contract/adapter.js +6 -0
- package/lib/commonjs/contract/adapter.js.map +1 -0
- package/lib/commonjs/contract/attachment.js +2 -0
- package/lib/commonjs/contract/attachment.js.map +1 -0
- package/lib/commonjs/contract/backup.js +2 -0
- package/lib/commonjs/contract/backup.js.map +1 -0
- package/lib/commonjs/contract/config.js +31 -0
- package/lib/commonjs/contract/config.js.map +1 -0
- package/lib/commonjs/contract/encryption.js +6 -0
- package/lib/commonjs/contract/encryption.js.map +1 -0
- package/lib/commonjs/contract/errors.js +64 -0
- package/lib/commonjs/contract/errors.js.map +1 -0
- package/lib/commonjs/contract/migration.js +6 -0
- package/lib/commonjs/contract/migration.js.map +1 -0
- package/lib/commonjs/contract/query.js +6 -0
- package/lib/commonjs/contract/query.js.map +1 -0
- package/lib/commonjs/contract/record.js +6 -0
- package/lib/commonjs/contract/record.js.map +1 -0
- package/lib/commonjs/contract/schema.js +2 -0
- package/lib/commonjs/contract/schema.js.map +1 -0
- package/lib/commonjs/contract/scope.js +2 -0
- package/lib/commonjs/contract/scope.js.map +1 -0
- package/lib/commonjs/contract/transaction.js +6 -0
- package/lib/commonjs/contract/transaction.js.map +1 -0
- package/lib/commonjs/crypto/chunked-cipher.js +147 -0
- package/lib/commonjs/crypto/chunked-cipher.js.map +1 -0
- package/lib/commonjs/crypto/derive.js +61 -0
- package/lib/commonjs/crypto/derive.js.map +1 -0
- package/lib/commonjs/crypto/key-provider.js +70 -0
- package/lib/commonjs/crypto/key-provider.js.map +1 -0
- package/lib/commonjs/crypto/provider.js +54 -0
- package/lib/commonjs/crypto/provider.js.map +1 -0
- package/lib/commonjs/diagnostics/dev-log.js +127 -0
- package/lib/commonjs/diagnostics/dev-log.js.map +1 -0
- package/lib/commonjs/diagnostics/errors.js +57 -0
- package/lib/commonjs/diagnostics/errors.js.map +1 -0
- package/lib/commonjs/diagnostics/faults.js +54 -0
- package/lib/commonjs/diagnostics/faults.js.map +1 -0
- package/lib/commonjs/diagnostics/map-native.js +98 -0
- package/lib/commonjs/diagnostics/map-native.js.map +1 -0
- package/lib/commonjs/diagnostics/redact.js +110 -0
- package/lib/commonjs/diagnostics/redact.js.map +1 -0
- package/lib/commonjs/index.js +70 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/migration/executor.js +136 -0
- package/lib/commonjs/migration/executor.js.map +1 -0
- package/lib/commonjs/migration/ledger.js +64 -0
- package/lib/commonjs/migration/ledger.js.map +1 -0
- package/lib/commonjs/migration/validate-chain.js +76 -0
- package/lib/commonjs/migration/validate-chain.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/platform/backup-android-verify.js +76 -0
- package/lib/commonjs/platform/backup-android-verify.js.map +1 -0
- package/lib/commonjs/platform/backup-ios.js +50 -0
- package/lib/commonjs/platform/backup-ios.js.map +1 -0
- package/lib/commonjs/platform/bytes.js +158 -0
- package/lib/commonjs/platform/bytes.js.map +1 -0
- package/lib/commonjs/platform/fs.js +59 -0
- package/lib/commonjs/platform/fs.js.map +1 -0
- package/lib/commonjs/platform/location.js +129 -0
- package/lib/commonjs/platform/location.js.map +1 -0
- package/lib/commonjs/query/budgets.js +95 -0
- package/lib/commonjs/query/budgets.js.map +1 -0
- package/lib/commonjs/query/compare.js +97 -0
- package/lib/commonjs/query/compare.js.map +1 -0
- package/lib/commonjs/query/cursor.js +97 -0
- package/lib/commonjs/query/cursor.js.map +1 -0
- package/lib/commonjs/query/filter.js +82 -0
- package/lib/commonjs/query/filter.js.map +1 -0
- package/lib/commonjs/query/paginate.js +48 -0
- package/lib/commonjs/query/paginate.js.map +1 -0
- package/lib/commonjs/query/sort.js +61 -0
- package/lib/commonjs/query/sort.js.map +1 -0
- package/lib/commonjs/query/validate.js +180 -0
- package/lib/commonjs/query/validate.js.map +1 -0
- package/lib/commonjs/schema/declare.js +47 -0
- package/lib/commonjs/schema/declare.js.map +1 -0
- package/lib/commonjs/schema/validate-config.js +115 -0
- package/lib/commonjs/schema/validate-config.js.map +1 -0
- package/lib/commonjs/scope/hash.js +107 -0
- package/lib/commonjs/scope/hash.js.map +1 -0
- package/lib/commonjs/scope/normalize.js +73 -0
- package/lib/commonjs/scope/normalize.js.map +1 -0
- package/lib/commonjs/scope/validate.js +81 -0
- package/lib/commonjs/scope/validate.js.map +1 -0
- package/lib/commonjs/sqlite/adapter.js +31 -0
- package/lib/commonjs/sqlite/adapter.js.map +1 -0
- package/lib/commonjs/sqlite/batch.js +218 -0
- package/lib/commonjs/sqlite/batch.js.map +1 -0
- package/lib/commonjs/sqlite/catalog.js +81 -0
- package/lib/commonjs/sqlite/catalog.js.map +1 -0
- package/lib/commonjs/sqlite/connection.js +210 -0
- package/lib/commonjs/sqlite/connection.js.map +1 -0
- package/lib/commonjs/sqlite/index-coverage.js +42 -0
- package/lib/commonjs/sqlite/index-coverage.js.map +1 -0
- package/lib/commonjs/sqlite/native.js +54 -0
- package/lib/commonjs/sqlite/native.js.map +1 -0
- package/lib/commonjs/sqlite/row-codec.js +192 -0
- package/lib/commonjs/sqlite/row-codec.js.map +1 -0
- package/lib/commonjs/sqlite/sql-builder.js +253 -0
- package/lib/commonjs/sqlite/sql-builder.js.map +1 -0
- package/lib/commonjs/sqlite/statements.js +54 -0
- package/lib/commonjs/sqlite/statements.js.map +1 -0
- package/lib/commonjs/sqlite/transaction-queue.js +79 -0
- package/lib/commonjs/sqlite/transaction-queue.js.map +1 -0
- package/lib/commonjs/sqlite/transactions.js +33 -0
- package/lib/commonjs/sqlite/transactions.js.map +1 -0
- package/lib/commonjs/sqlite/values.js +31 -0
- package/lib/commonjs/sqlite/values.js.map +1 -0
- package/lib/commonjs/testing/conformance/attachments.js +180 -0
- package/lib/commonjs/testing/conformance/attachments.js.map +1 -0
- package/lib/commonjs/testing/conformance/encryption.js +187 -0
- package/lib/commonjs/testing/conformance/encryption.js.map +1 -0
- package/lib/commonjs/testing/conformance/index.js +103 -0
- package/lib/commonjs/testing/conformance/index.js.map +1 -0
- package/lib/commonjs/testing/conformance/lifecycle.js +134 -0
- package/lib/commonjs/testing/conformance/lifecycle.js.map +1 -0
- package/lib/commonjs/testing/conformance/migrations.js +167 -0
- package/lib/commonjs/testing/conformance/migrations.js.map +1 -0
- package/lib/commonjs/testing/conformance/queries.js +278 -0
- package/lib/commonjs/testing/conformance/queries.js.map +1 -0
- package/lib/commonjs/testing/conformance/records.js +224 -0
- package/lib/commonjs/testing/conformance/records.js.map +1 -0
- package/lib/commonjs/testing/conformance/scopes.js +107 -0
- package/lib/commonjs/testing/conformance/scopes.js.map +1 -0
- package/lib/commonjs/testing/conformance/transactions.js +228 -0
- package/lib/commonjs/testing/conformance/transactions.js.map +1 -0
- package/lib/commonjs/testing/faults.js +38 -0
- package/lib/commonjs/testing/faults.js.map +1 -0
- package/lib/commonjs/testing/index.js +59 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/attachments.js +145 -0
- package/lib/commonjs/testing/memory-adapter/attachments.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/collection.js +224 -0
- package/lib/commonjs/testing/memory-adapter/collection.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/index.js +366 -0
- package/lib/commonjs/testing/memory-adapter/index.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/migrations.js +126 -0
- package/lib/commonjs/testing/memory-adapter/migrations.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/reset.js +49 -0
- package/lib/commonjs/testing/memory-adapter/reset.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/store.js +107 -0
- package/lib/commonjs/testing/memory-adapter/store.js.map +1 -0
- package/lib/module/adapter/budgets.js +51 -0
- package/lib/module/adapter/budgets.js.map +1 -0
- package/lib/module/adapter/collection.js +232 -0
- package/lib/module/adapter/collection.js.map +1 -0
- package/lib/module/adapter/deletion.js +280 -0
- package/lib/module/adapter/deletion.js.map +1 -0
- package/lib/module/adapter/handle.js +254 -0
- package/lib/module/adapter/handle.js.map +1 -0
- package/lib/module/adapter/index.js +59 -0
- package/lib/module/adapter/index.js.map +1 -0
- package/lib/module/adapter/lifecycle.js +172 -0
- package/lib/module/adapter/lifecycle.js.map +1 -0
- package/lib/module/adapter/schema-sync.js +121 -0
- package/lib/module/adapter/schema-sync.js.map +1 -0
- package/lib/module/adapter/transaction.js +54 -0
- package/lib/module/adapter/transaction.js.map +1 -0
- package/lib/module/artifacts/availability.js +86 -0
- package/lib/module/artifacts/availability.js.map +1 -0
- package/lib/module/artifacts/cascade.js +75 -0
- package/lib/module/artifacts/cascade.js.map +1 -0
- package/lib/module/artifacts/paths.js +26 -0
- package/lib/module/artifacts/paths.js.map +1 -0
- package/lib/module/artifacts/reconcile.js +51 -0
- package/lib/module/artifacts/reconcile.js.map +1 -0
- package/lib/module/artifacts/store.js +289 -0
- package/lib/module/artifacts/store.js.map +1 -0
- package/lib/module/contract/adapter.js +4 -0
- package/lib/module/contract/adapter.js.map +1 -0
- package/lib/module/contract/attachment.js +2 -0
- package/lib/module/contract/attachment.js.map +1 -0
- package/lib/module/contract/backup.js +2 -0
- package/lib/module/contract/backup.js.map +1 -0
- package/lib/module/contract/config.js +27 -0
- package/lib/module/contract/config.js.map +1 -0
- package/lib/module/contract/encryption.js +4 -0
- package/lib/module/contract/encryption.js.map +1 -0
- package/lib/module/contract/errors.js +60 -0
- package/lib/module/contract/errors.js.map +1 -0
- package/lib/module/contract/migration.js +4 -0
- package/lib/module/contract/migration.js.map +1 -0
- package/lib/module/contract/query.js +4 -0
- package/lib/module/contract/query.js.map +1 -0
- package/lib/module/contract/record.js +4 -0
- package/lib/module/contract/record.js.map +1 -0
- package/lib/module/contract/schema.js +2 -0
- package/lib/module/contract/schema.js.map +1 -0
- package/lib/module/contract/scope.js +2 -0
- package/lib/module/contract/scope.js.map +1 -0
- package/lib/module/contract/transaction.js +4 -0
- package/lib/module/contract/transaction.js.map +1 -0
- package/lib/module/crypto/chunked-cipher.js +134 -0
- package/lib/module/crypto/chunked-cipher.js.map +1 -0
- package/lib/module/crypto/derive.js +56 -0
- package/lib/module/crypto/derive.js.map +1 -0
- package/lib/module/crypto/key-provider.js +67 -0
- package/lib/module/crypto/key-provider.js.map +1 -0
- package/lib/module/crypto/provider.js +49 -0
- package/lib/module/crypto/provider.js.map +1 -0
- package/lib/module/diagnostics/dev-log.js +120 -0
- package/lib/module/diagnostics/dev-log.js.map +1 -0
- package/lib/module/diagnostics/errors.js +44 -0
- package/lib/module/diagnostics/errors.js.map +1 -0
- package/lib/module/diagnostics/faults.js +47 -0
- package/lib/module/diagnostics/faults.js.map +1 -0
- package/lib/module/diagnostics/map-native.js +93 -0
- package/lib/module/diagnostics/map-native.js.map +1 -0
- package/lib/module/diagnostics/redact.js +102 -0
- package/lib/module/diagnostics/redact.js.map +1 -0
- package/lib/module/index.js +28 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/migration/executor.js +132 -0
- package/lib/module/migration/executor.js.map +1 -0
- package/lib/module/migration/ledger.js +57 -0
- package/lib/module/migration/ledger.js.map +1 -0
- package/lib/module/migration/validate-chain.js +70 -0
- package/lib/module/migration/validate-chain.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/platform/backup-android-verify.js +69 -0
- package/lib/module/platform/backup-android-verify.js.map +1 -0
- package/lib/module/platform/backup-ios.js +44 -0
- package/lib/module/platform/backup-ios.js.map +1 -0
- package/lib/module/platform/bytes.js +148 -0
- package/lib/module/platform/bytes.js.map +1 -0
- package/lib/module/platform/fs.js +54 -0
- package/lib/module/platform/fs.js.map +1 -0
- package/lib/module/platform/location.js +120 -0
- package/lib/module/platform/location.js.map +1 -0
- package/lib/module/query/budgets.js +88 -0
- package/lib/module/query/budgets.js.map +1 -0
- package/lib/module/query/compare.js +90 -0
- package/lib/module/query/compare.js.map +1 -0
- package/lib/module/query/cursor.js +91 -0
- package/lib/module/query/cursor.js.map +1 -0
- package/lib/module/query/filter.js +78 -0
- package/lib/module/query/filter.js.map +1 -0
- package/lib/module/query/paginate.js +40 -0
- package/lib/module/query/paginate.js.map +1 -0
- package/lib/module/query/sort.js +53 -0
- package/lib/module/query/sort.js.map +1 -0
- package/lib/module/query/validate.js +173 -0
- package/lib/module/query/validate.js.map +1 -0
- package/lib/module/schema/declare.js +37 -0
- package/lib/module/schema/declare.js.map +1 -0
- package/lib/module/schema/validate-config.js +111 -0
- package/lib/module/schema/validate-config.js.map +1 -0
- package/lib/module/scope/hash.js +102 -0
- package/lib/module/scope/hash.js.map +1 -0
- package/lib/module/scope/normalize.js +67 -0
- package/lib/module/scope/normalize.js.map +1 -0
- package/lib/module/scope/validate.js +76 -0
- package/lib/module/scope/validate.js.map +1 -0
- package/lib/module/sqlite/adapter.js +27 -0
- package/lib/module/sqlite/adapter.js.map +1 -0
- package/lib/module/sqlite/batch.js +214 -0
- package/lib/module/sqlite/batch.js.map +1 -0
- package/lib/module/sqlite/catalog.js +72 -0
- package/lib/module/sqlite/catalog.js.map +1 -0
- package/lib/module/sqlite/connection.js +206 -0
- package/lib/module/sqlite/connection.js.map +1 -0
- package/lib/module/sqlite/index-coverage.js +38 -0
- package/lib/module/sqlite/index-coverage.js.map +1 -0
- package/lib/module/sqlite/native.js +48 -0
- package/lib/module/sqlite/native.js.map +1 -0
- package/lib/module/sqlite/row-codec.js +176 -0
- package/lib/module/sqlite/row-codec.js.map +1 -0
- package/lib/module/sqlite/sql-builder.js +247 -0
- package/lib/module/sqlite/sql-builder.js.map +1 -0
- package/lib/module/sqlite/statements.js +49 -0
- package/lib/module/sqlite/statements.js.map +1 -0
- package/lib/module/sqlite/transaction-queue.js +75 -0
- package/lib/module/sqlite/transaction-queue.js.map +1 -0
- package/lib/module/sqlite/transactions.js +29 -0
- package/lib/module/sqlite/transactions.js.map +1 -0
- package/lib/module/sqlite/values.js +24 -0
- package/lib/module/sqlite/values.js.map +1 -0
- package/lib/module/testing/conformance/attachments.js +176 -0
- package/lib/module/testing/conformance/attachments.js.map +1 -0
- package/lib/module/testing/conformance/encryption.js +183 -0
- package/lib/module/testing/conformance/encryption.js.map +1 -0
- package/lib/module/testing/conformance/index.js +97 -0
- package/lib/module/testing/conformance/index.js.map +1 -0
- package/lib/module/testing/conformance/lifecycle.js +130 -0
- package/lib/module/testing/conformance/lifecycle.js.map +1 -0
- package/lib/module/testing/conformance/migrations.js +163 -0
- package/lib/module/testing/conformance/migrations.js.map +1 -0
- package/lib/module/testing/conformance/queries.js +274 -0
- package/lib/module/testing/conformance/queries.js.map +1 -0
- package/lib/module/testing/conformance/records.js +220 -0
- package/lib/module/testing/conformance/records.js.map +1 -0
- package/lib/module/testing/conformance/scopes.js +103 -0
- package/lib/module/testing/conformance/scopes.js.map +1 -0
- package/lib/module/testing/conformance/transactions.js +224 -0
- package/lib/module/testing/conformance/transactions.js.map +1 -0
- package/lib/module/testing/faults.js +16 -0
- package/lib/module/testing/faults.js.map +1 -0
- package/lib/module/testing/index.js +16 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/module/testing/memory-adapter/attachments.js +142 -0
- package/lib/module/testing/memory-adapter/attachments.js.map +1 -0
- package/lib/module/testing/memory-adapter/collection.js +220 -0
- package/lib/module/testing/memory-adapter/collection.js.map +1 -0
- package/lib/module/testing/memory-adapter/index.js +351 -0
- package/lib/module/testing/memory-adapter/index.js.map +1 -0
- package/lib/module/testing/memory-adapter/migrations.js +122 -0
- package/lib/module/testing/memory-adapter/migrations.js.map +1 -0
- package/lib/module/testing/memory-adapter/reset.js +44 -0
- package/lib/module/testing/memory-adapter/reset.js.map +1 -0
- package/lib/module/testing/memory-adapter/store.js +94 -0
- package/lib/module/testing/memory-adapter/store.js.map +1 -0
- package/lib/typescript/commonjs/adapter/budgets.d.ts +19 -0
- package/lib/typescript/commonjs/adapter/budgets.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/collection.d.ts +25 -0
- package/lib/typescript/commonjs/adapter/collection.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/deletion.d.ts +48 -0
- package/lib/typescript/commonjs/adapter/deletion.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/handle.d.ts +30 -0
- package/lib/typescript/commonjs/adapter/handle.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/index.d.ts +30 -0
- package/lib/typescript/commonjs/adapter/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/lifecycle.d.ts +25 -0
- package/lib/typescript/commonjs/adapter/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/schema-sync.d.ts +19 -0
- package/lib/typescript/commonjs/adapter/schema-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/transaction.d.ts +32 -0
- package/lib/typescript/commonjs/adapter/transaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/availability.d.ts +19 -0
- package/lib/typescript/commonjs/artifacts/availability.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/cascade.d.ts +26 -0
- package/lib/typescript/commonjs/artifacts/cascade.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/paths.d.ts +16 -0
- package/lib/typescript/commonjs/artifacts/paths.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/reconcile.d.ts +23 -0
- package/lib/typescript/commonjs/artifacts/reconcile.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/store.d.ts +45 -0
- package/lib/typescript/commonjs/artifacts/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/adapter.d.ts +55 -0
- package/lib/typescript/commonjs/contract/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/attachment.d.ts +84 -0
- package/lib/typescript/commonjs/contract/attachment.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/backup.d.ts +26 -0
- package/lib/typescript/commonjs/contract/backup.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/config.d.ts +50 -0
- package/lib/typescript/commonjs/contract/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/encryption.d.ts +31 -0
- package/lib/typescript/commonjs/contract/encryption.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/errors.d.ts +50 -0
- package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/migration.d.ts +37 -0
- package/lib/typescript/commonjs/contract/migration.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/query.d.ts +79 -0
- package/lib/typescript/commonjs/contract/query.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/record.d.ts +43 -0
- package/lib/typescript/commonjs/contract/record.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/schema.d.ts +33 -0
- package/lib/typescript/commonjs/contract/schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/scope.d.ts +33 -0
- package/lib/typescript/commonjs/contract/scope.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/transaction.d.ts +66 -0
- package/lib/typescript/commonjs/contract/transaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts +57 -0
- package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/derive.d.ts +28 -0
- package/lib/typescript/commonjs/crypto/derive.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/key-provider.d.ts +30 -0
- package/lib/typescript/commonjs/crypto/key-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/provider.d.ts +35 -0
- package/lib/typescript/commonjs/crypto/provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/dev-log.d.ts +35 -0
- package/lib/typescript/commonjs/diagnostics/dev-log.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts +34 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/faults.d.ts +26 -0
- package/lib/typescript/commonjs/diagnostics/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/map-native.d.ts +31 -0
- package/lib/typescript/commonjs/diagnostics/map-native.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts +70 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +30 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/executor.d.ts +40 -0
- package/lib/typescript/commonjs/migration/executor.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/ledger.d.ts +34 -0
- package/lib/typescript/commonjs/migration/ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/validate-chain.d.ts +20 -0
- package/lib/typescript/commonjs/migration/validate-chain.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/platform/backup-android-verify.d.ts +30 -0
- package/lib/typescript/commonjs/platform/backup-android-verify.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/backup-ios.d.ts +26 -0
- package/lib/typescript/commonjs/platform/backup-ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/bytes.d.ts +36 -0
- package/lib/typescript/commonjs/platform/bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/fs.d.ts +47 -0
- package/lib/typescript/commonjs/platform/fs.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/location.d.ts +53 -0
- package/lib/typescript/commonjs/platform/location.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/budgets.d.ts +23 -0
- package/lib/typescript/commonjs/query/budgets.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/compare.d.ts +42 -0
- package/lib/typescript/commonjs/query/compare.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/cursor.d.ts +27 -0
- package/lib/typescript/commonjs/query/cursor.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/filter.d.ts +11 -0
- package/lib/typescript/commonjs/query/filter.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/paginate.d.ts +15 -0
- package/lib/typescript/commonjs/query/paginate.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/sort.d.ts +19 -0
- package/lib/typescript/commonjs/query/sort.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/validate.d.ts +15 -0
- package/lib/typescript/commonjs/query/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/schema/declare.d.ts +20 -0
- package/lib/typescript/commonjs/schema/declare.d.ts.map +1 -0
- package/lib/typescript/commonjs/schema/validate-config.d.ts +11 -0
- package/lib/typescript/commonjs/schema/validate-config.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/hash.d.ts +24 -0
- package/lib/typescript/commonjs/scope/hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/normalize.d.ts +46 -0
- package/lib/typescript/commonjs/scope/normalize.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/validate.d.ts +15 -0
- package/lib/typescript/commonjs/scope/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/adapter.d.ts +16 -0
- package/lib/typescript/commonjs/sqlite/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/batch.d.ts +25 -0
- package/lib/typescript/commonjs/sqlite/batch.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/catalog.d.ts +34 -0
- package/lib/typescript/commonjs/sqlite/catalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/connection.d.ts +58 -0
- package/lib/typescript/commonjs/sqlite/connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/index-coverage.d.ts +18 -0
- package/lib/typescript/commonjs/sqlite/index-coverage.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/native.d.ts +48 -0
- package/lib/typescript/commonjs/sqlite/native.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/row-codec.d.ts +69 -0
- package/lib/typescript/commonjs/sqlite/row-codec.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/sql-builder.d.ts +34 -0
- package/lib/typescript/commonjs/sqlite/sql-builder.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/statements.d.ts +26 -0
- package/lib/typescript/commonjs/sqlite/statements.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts +31 -0
- package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/transactions.d.ts +26 -0
- package/lib/typescript/commonjs/sqlite/transactions.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/values.d.ts +13 -0
- package/lib/typescript/commonjs/sqlite/values.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/attachments.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/attachments.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/encryption.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/encryption.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts +58 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/migrations.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/migrations.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/queries.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/queries.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/records.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/records.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/scopes.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/scopes.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/transactions.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/transactions.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/faults.d.ts +13 -0
- package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +13 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts +23 -0
- package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts +19 -0
- package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts +22 -0
- package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts +11 -0
- package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts +23 -0
- package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts +54 -0
- package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts.map +1 -0
- package/lib/typescript/module/adapter/budgets.d.ts +19 -0
- package/lib/typescript/module/adapter/budgets.d.ts.map +1 -0
- package/lib/typescript/module/adapter/collection.d.ts +25 -0
- package/lib/typescript/module/adapter/collection.d.ts.map +1 -0
- package/lib/typescript/module/adapter/deletion.d.ts +48 -0
- package/lib/typescript/module/adapter/deletion.d.ts.map +1 -0
- package/lib/typescript/module/adapter/handle.d.ts +30 -0
- package/lib/typescript/module/adapter/handle.d.ts.map +1 -0
- package/lib/typescript/module/adapter/index.d.ts +30 -0
- package/lib/typescript/module/adapter/index.d.ts.map +1 -0
- package/lib/typescript/module/adapter/lifecycle.d.ts +25 -0
- package/lib/typescript/module/adapter/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/adapter/schema-sync.d.ts +19 -0
- package/lib/typescript/module/adapter/schema-sync.d.ts.map +1 -0
- package/lib/typescript/module/adapter/transaction.d.ts +32 -0
- package/lib/typescript/module/adapter/transaction.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/availability.d.ts +19 -0
- package/lib/typescript/module/artifacts/availability.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/cascade.d.ts +26 -0
- package/lib/typescript/module/artifacts/cascade.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/paths.d.ts +16 -0
- package/lib/typescript/module/artifacts/paths.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/reconcile.d.ts +23 -0
- package/lib/typescript/module/artifacts/reconcile.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/store.d.ts +45 -0
- package/lib/typescript/module/artifacts/store.d.ts.map +1 -0
- package/lib/typescript/module/contract/adapter.d.ts +55 -0
- package/lib/typescript/module/contract/adapter.d.ts.map +1 -0
- package/lib/typescript/module/contract/attachment.d.ts +84 -0
- package/lib/typescript/module/contract/attachment.d.ts.map +1 -0
- package/lib/typescript/module/contract/backup.d.ts +26 -0
- package/lib/typescript/module/contract/backup.d.ts.map +1 -0
- package/lib/typescript/module/contract/config.d.ts +50 -0
- package/lib/typescript/module/contract/config.d.ts.map +1 -0
- package/lib/typescript/module/contract/encryption.d.ts +31 -0
- package/lib/typescript/module/contract/encryption.d.ts.map +1 -0
- package/lib/typescript/module/contract/errors.d.ts +50 -0
- package/lib/typescript/module/contract/errors.d.ts.map +1 -0
- package/lib/typescript/module/contract/migration.d.ts +37 -0
- package/lib/typescript/module/contract/migration.d.ts.map +1 -0
- package/lib/typescript/module/contract/query.d.ts +79 -0
- package/lib/typescript/module/contract/query.d.ts.map +1 -0
- package/lib/typescript/module/contract/record.d.ts +43 -0
- package/lib/typescript/module/contract/record.d.ts.map +1 -0
- package/lib/typescript/module/contract/schema.d.ts +33 -0
- package/lib/typescript/module/contract/schema.d.ts.map +1 -0
- package/lib/typescript/module/contract/scope.d.ts +33 -0
- package/lib/typescript/module/contract/scope.d.ts.map +1 -0
- package/lib/typescript/module/contract/transaction.d.ts +66 -0
- package/lib/typescript/module/contract/transaction.d.ts.map +1 -0
- package/lib/typescript/module/crypto/chunked-cipher.d.ts +57 -0
- package/lib/typescript/module/crypto/chunked-cipher.d.ts.map +1 -0
- package/lib/typescript/module/crypto/derive.d.ts +28 -0
- package/lib/typescript/module/crypto/derive.d.ts.map +1 -0
- package/lib/typescript/module/crypto/key-provider.d.ts +30 -0
- package/lib/typescript/module/crypto/key-provider.d.ts.map +1 -0
- package/lib/typescript/module/crypto/provider.d.ts +35 -0
- package/lib/typescript/module/crypto/provider.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/dev-log.d.ts +35 -0
- package/lib/typescript/module/diagnostics/dev-log.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/errors.d.ts +34 -0
- package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/faults.d.ts +26 -0
- package/lib/typescript/module/diagnostics/faults.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/map-native.d.ts +31 -0
- package/lib/typescript/module/diagnostics/map-native.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/redact.d.ts +70 -0
- package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +30 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/migration/executor.d.ts +40 -0
- package/lib/typescript/module/migration/executor.d.ts.map +1 -0
- package/lib/typescript/module/migration/ledger.d.ts +34 -0
- package/lib/typescript/module/migration/ledger.d.ts.map +1 -0
- package/lib/typescript/module/migration/validate-chain.d.ts +20 -0
- package/lib/typescript/module/migration/validate-chain.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/platform/backup-android-verify.d.ts +30 -0
- package/lib/typescript/module/platform/backup-android-verify.d.ts.map +1 -0
- package/lib/typescript/module/platform/backup-ios.d.ts +26 -0
- package/lib/typescript/module/platform/backup-ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/bytes.d.ts +36 -0
- package/lib/typescript/module/platform/bytes.d.ts.map +1 -0
- package/lib/typescript/module/platform/fs.d.ts +47 -0
- package/lib/typescript/module/platform/fs.d.ts.map +1 -0
- package/lib/typescript/module/platform/location.d.ts +53 -0
- package/lib/typescript/module/platform/location.d.ts.map +1 -0
- package/lib/typescript/module/query/budgets.d.ts +23 -0
- package/lib/typescript/module/query/budgets.d.ts.map +1 -0
- package/lib/typescript/module/query/compare.d.ts +42 -0
- package/lib/typescript/module/query/compare.d.ts.map +1 -0
- package/lib/typescript/module/query/cursor.d.ts +27 -0
- package/lib/typescript/module/query/cursor.d.ts.map +1 -0
- package/lib/typescript/module/query/filter.d.ts +11 -0
- package/lib/typescript/module/query/filter.d.ts.map +1 -0
- package/lib/typescript/module/query/paginate.d.ts +15 -0
- package/lib/typescript/module/query/paginate.d.ts.map +1 -0
- package/lib/typescript/module/query/sort.d.ts +19 -0
- package/lib/typescript/module/query/sort.d.ts.map +1 -0
- package/lib/typescript/module/query/validate.d.ts +15 -0
- package/lib/typescript/module/query/validate.d.ts.map +1 -0
- package/lib/typescript/module/schema/declare.d.ts +20 -0
- package/lib/typescript/module/schema/declare.d.ts.map +1 -0
- package/lib/typescript/module/schema/validate-config.d.ts +11 -0
- package/lib/typescript/module/schema/validate-config.d.ts.map +1 -0
- package/lib/typescript/module/scope/hash.d.ts +24 -0
- package/lib/typescript/module/scope/hash.d.ts.map +1 -0
- package/lib/typescript/module/scope/normalize.d.ts +46 -0
- package/lib/typescript/module/scope/normalize.d.ts.map +1 -0
- package/lib/typescript/module/scope/validate.d.ts +15 -0
- package/lib/typescript/module/scope/validate.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/adapter.d.ts +16 -0
- package/lib/typescript/module/sqlite/adapter.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/batch.d.ts +25 -0
- package/lib/typescript/module/sqlite/batch.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/catalog.d.ts +34 -0
- package/lib/typescript/module/sqlite/catalog.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/connection.d.ts +58 -0
- package/lib/typescript/module/sqlite/connection.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/index-coverage.d.ts +18 -0
- package/lib/typescript/module/sqlite/index-coverage.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/native.d.ts +48 -0
- package/lib/typescript/module/sqlite/native.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/row-codec.d.ts +69 -0
- package/lib/typescript/module/sqlite/row-codec.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/sql-builder.d.ts +34 -0
- package/lib/typescript/module/sqlite/sql-builder.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/statements.d.ts +26 -0
- package/lib/typescript/module/sqlite/statements.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/transaction-queue.d.ts +31 -0
- package/lib/typescript/module/sqlite/transaction-queue.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/transactions.d.ts +26 -0
- package/lib/typescript/module/sqlite/transactions.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/values.d.ts +13 -0
- package/lib/typescript/module/sqlite/values.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/attachments.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/attachments.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/encryption.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/encryption.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/index.d.ts +58 -0
- package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/lifecycle.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/migrations.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/migrations.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/queries.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/queries.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/records.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/records.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/scopes.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/scopes.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/transactions.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/transactions.d.ts.map +1 -0
- package/lib/typescript/module/testing/faults.d.ts +13 -0
- package/lib/typescript/module/testing/faults.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +13 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/attachments.d.ts +23 -0
- package/lib/typescript/module/testing/memory-adapter/attachments.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/collection.d.ts +19 -0
- package/lib/typescript/module/testing/memory-adapter/collection.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/index.d.ts +22 -0
- package/lib/typescript/module/testing/memory-adapter/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/migrations.d.ts +11 -0
- package/lib/typescript/module/testing/memory-adapter/migrations.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/reset.d.ts +23 -0
- package/lib/typescript/module/testing/memory-adapter/reset.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/store.d.ts +54 -0
- package/lib/typescript/module/testing/memory-adapter/store.d.ts.map +1 -0
- package/package.json +51 -16
- package/skills/sdk-rn-local-db/SKILL.md +1 -1
- package/src/adapter/budgets.ts +1 -10
- package/src/adapter/collection.ts +38 -66
- package/src/adapter/deletion.ts +48 -0
- package/src/adapter/handle.ts +311 -0
- package/src/adapter/lifecycle.ts +10 -338
- package/src/adapter/schema-sync.ts +155 -0
- package/src/artifacts/cascade.ts +0 -14
- package/src/artifacts/store.ts +60 -10
- package/src/contract/attachment.ts +24 -3
- package/src/contract/migration.ts +4 -1
- package/src/crypto/provider.ts +7 -3
- package/src/diagnostics/dev-log.ts +5 -1
- package/src/migration/executor.ts +27 -6
- package/src/migration/ledger.ts +18 -27
- package/src/platform/fs.ts +2 -8
- package/src/platform/location.ts +0 -3
- package/src/query/budgets.ts +32 -5
- package/src/schema/validate-config.ts +3 -53
- package/src/sqlite/batch.ts +40 -51
- package/src/sqlite/connection.ts +0 -9
- package/src/sqlite/row-codec.ts +5 -2
- package/src/sqlite/statements.ts +74 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/memory-adapter/attachments.ts +146 -0
- package/src/testing/memory-adapter/index.ts +13 -111
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/attachments.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAAwB,CAAC;AAe1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAS,CAAC;AAEpD,iFAAiF;AACjF,MAAM,WAAW,QAAQ;IACxB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,IAGzD,WAAW,QAAQ,KAAG,WAAW,CAwGzC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection operations over the in-memory store.
|
|
3
|
+
*
|
|
4
|
+
* Every semantic decision — filtering, sorting, paging — is delegated to
|
|
5
|
+
* `query/`, the module the SQLite adapter also validates through. Anything
|
|
6
|
+
* decided here instead would be a place the two adapters could drift.
|
|
7
|
+
*/
|
|
8
|
+
import type { StorableRecordData } from '../../contract/record.js';
|
|
9
|
+
import type { CollectionSchema } from '../../contract/schema.js';
|
|
10
|
+
import type { CollectionOps } from '../../contract/transaction.js';
|
|
11
|
+
import { type MemoryScopeStore } from './store.js';
|
|
12
|
+
export type CollectionContext = {
|
|
13
|
+
store: MemoryScopeStore;
|
|
14
|
+
schema: CollectionSchema;
|
|
15
|
+
now: () => number;
|
|
16
|
+
assertOpen: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function createMemoryCollection<T extends StorableRecordData>(context: CollectionContext): CollectionOps<T>;
|
|
19
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/collection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAEX,kBAAkB,EAGlB,MAAM,0BAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA4B,CAAC;AAShE,OAAO,EAAgD,KAAK,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAE9F,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AASF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,kBAAkB,EAClE,OAAO,EAAE,iBAAiB,GACxB,aAAa,CAAC,CAAC,CAAC,CAyKlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The in-memory adapter.
|
|
3
|
+
*
|
|
4
|
+
* Not a convenience: op-sqlite is native and unreachable from Jest, so this
|
|
5
|
+
* is the only way the package's own guarantees are testable in CI
|
|
6
|
+
* (research.md R8). Documented divergences are listed in the package README.
|
|
7
|
+
*/
|
|
8
|
+
import type { StorageAdapter } from '../../contract/adapter.js';
|
|
9
|
+
export type MemoryAdapterOptions = {
|
|
10
|
+
/** Fixed clock, so timestamp assertions are deterministic. */
|
|
11
|
+
now?: () => number;
|
|
12
|
+
/**
|
|
13
|
+
* What a `sourcePath` attachment reads, as base64. There is no filesystem
|
|
14
|
+
* behind this adapter, so a test that writes attachments by path supplies
|
|
15
|
+
* the bytes here; without it such a write is refused with `STORAGE_ACCESS`.
|
|
16
|
+
*/
|
|
17
|
+
readSourceFile?: (path: string) => Promise<string> | string;
|
|
18
|
+
};
|
|
19
|
+
export declare function createMemoryAdapter(options?: MemoryAdapterOptions): StorageAdapter;
|
|
20
|
+
export { Budgets } from '../../contract/config.js';
|
|
21
|
+
export { activeFaults } from '../faults.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,2BAAwB,CAAC;AAoB7E,MAAM,MAAM,oBAAoB,GAAG;IAClC,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC5D,CAAC;AA0BF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,cAAc,CAwUtF;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,0BAAuB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration execution for the in-memory adapter.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the on-device rules exactly, because migration behaviour is the
|
|
5
|
+
* thing consumers most need to test without a device: ordered, at most once
|
|
6
|
+
* per scope, atomic per step, and loud on failure (FR-047 to FR-057).
|
|
7
|
+
*/
|
|
8
|
+
import type { DatabaseConfig } from '../../contract/config.js';
|
|
9
|
+
import type { MemoryScopeStore } from './store.js';
|
|
10
|
+
export declare function runMigrations(store: MemoryScopeStore, config: DatabaseConfig, now: () => number): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAAuB,CAAC;AAK5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEhD,wBAAsB,aAAa,CAClC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,MAAM,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA0Ef"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test lifecycle helpers.
|
|
3
|
+
*
|
|
4
|
+
* `seedRecords` deliberately goes through the same write operations
|
|
5
|
+
* production code uses (FR-094). Seeding by poking the store directly would
|
|
6
|
+
* skip budget checks and timestamp handling, so tests would pass against data
|
|
7
|
+
* the package would have refused to store.
|
|
8
|
+
*/
|
|
9
|
+
import type { StorageAdapter } from '../../contract/adapter.js';
|
|
10
|
+
import type { DatabaseConfig } from '../../contract/config.js';
|
|
11
|
+
import type { RecordInput, StorableRecordData } from '../../contract/record.js';
|
|
12
|
+
/**
|
|
13
|
+
* The conformance suite's "reach past the package" hooks, implemented for the
|
|
14
|
+
* in-memory store. On device the equivalent unlinks the file directly.
|
|
15
|
+
*/
|
|
16
|
+
export declare const memoryConformanceHooks: {
|
|
17
|
+
removeArtifactBehindTheScenes(scopeKey: string, attachmentId: string): Promise<void>;
|
|
18
|
+
removeReferenceBehindTheScenes(scopeKey: string, attachmentId: string): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
/** Return every in-memory database to a known-empty state (FR-093). */
|
|
21
|
+
export declare function resetMemoryAdapter(_adapter?: StorageAdapter): Promise<void>;
|
|
22
|
+
export declare function seedRecords<T extends StorableRecordData>(adapter: StorageAdapter, config: DatabaseConfig, collection: string, records: RecordInput<T>[]): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=reset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/reset.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,0BAAuB,CAAC;AAI7E;;;GAGG;AACH,eAAO,MAAM,sBAAsB;4CACY,MAAM,gBAAgB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;6CAG3C,MAAM,gBAAgB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3F,CAAC;AAEF,uEAAuE;AACvE,wBAAsB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjF;AAED,wBAAsB,WAAW,CAAC,CAAC,SAAS,kBAAkB,EAC7D,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GACvB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The in-memory store behind the test adapter.
|
|
3
|
+
*
|
|
4
|
+
* Scope isolation is structural here for the same reason it is on device: one
|
|
5
|
+
* store per scope, held in a registry keyed by scope digest. A handle holds a
|
|
6
|
+
* reference to its own store and has no way to reach another (FR-011).
|
|
7
|
+
*/
|
|
8
|
+
import type { AttachmentReference } from '../../contract/attachment.js';
|
|
9
|
+
import type { MigrationLedgerEntry } from '../../contract/migration.js';
|
|
10
|
+
import type { StorableRecordData, StoredRecord } from '../../contract/record.js';
|
|
11
|
+
import type { ScopeDeletionState } from '../../contract/scope.js';
|
|
12
|
+
export type MemoryRow = {
|
|
13
|
+
id: string;
|
|
14
|
+
/** Serialized on write, parsed on read — the same payload-as-truth rule
|
|
15
|
+
* the SQLite adapter follows, so a mutation after write cannot leak in. */
|
|
16
|
+
payload: string;
|
|
17
|
+
createdAt?: number | undefined;
|
|
18
|
+
updatedAt?: number | undefined;
|
|
19
|
+
deletedAt?: number | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type MemoryScopeStore = {
|
|
22
|
+
scopeKey: string;
|
|
23
|
+
schemaVersion: number;
|
|
24
|
+
ledger: Map<number, MigrationLedgerEntry>;
|
|
25
|
+
collections: Map<string, Map<string, MemoryRow>>;
|
|
26
|
+
attachments: Map<string, AttachmentReference>;
|
|
27
|
+
artifacts: Map<string, string>;
|
|
28
|
+
deletionState: ScopeDeletionState;
|
|
29
|
+
encrypted: boolean;
|
|
30
|
+
backupIncluded: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type MemoryDatabase = {
|
|
33
|
+
name: string;
|
|
34
|
+
scopes: Map<string, MemoryScopeStore>;
|
|
35
|
+
};
|
|
36
|
+
export declare function databaseFor(name: string): MemoryDatabase;
|
|
37
|
+
export declare function scopeStoreFor(name: string, scopeKey: string): MemoryScopeStore;
|
|
38
|
+
export declare function existingScopeStore(name: string, scopeKey: string): MemoryScopeStore | undefined;
|
|
39
|
+
export declare function dropScope(name: string, scopeKey: string): void;
|
|
40
|
+
export declare function dropDatabase(name: string): void;
|
|
41
|
+
/** Between tests (FR-093). */
|
|
42
|
+
export declare function resetAllMemoryStores(): void;
|
|
43
|
+
export declare function collectionMap(store: MemoryScopeStore, collection: string): Map<string, MemoryRow>;
|
|
44
|
+
/**
|
|
45
|
+
* Deep copy through serialization on the way in and out.
|
|
46
|
+
*
|
|
47
|
+
* The same discipline as the SQLite adapter's payload column: a consumer that
|
|
48
|
+
* mutates the object it handed us must not change what is stored (FR-022),
|
|
49
|
+
* and what we hand back must not be a live reference into the store.
|
|
50
|
+
*/
|
|
51
|
+
export declare function encodePayload(data: StorableRecordData): string;
|
|
52
|
+
export declare function decodePayload<T extends StorableRecordData>(payload: string): T;
|
|
53
|
+
export declare function toStoredRecord<T extends StorableRecordData>(row: MemoryRow): StoredRecord<T>;
|
|
54
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../src/testing/memory-adapter/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX;+EAC2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC1C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACjD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC9C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,aAAa,EAAE,kBAAkB,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACtC,CAAC;AAIF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAOxD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAkB9E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE/F;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE9D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,8BAA8B;AAC9B,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAOjG;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAE9D;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAE9E;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,kBAAkB,EAAE,GAAG,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,CAe5F"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipmobilesdk/rn-local-db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"source": "./src/index.ts",
|
|
7
|
+
"main": "./lib/commonjs/index.js",
|
|
8
|
+
"module": "./lib/module/index.js",
|
|
9
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
8
10
|
"exports": {
|
|
9
11
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
12
|
+
"chipmobilesdk-source": "./src/index.ts",
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
15
|
+
"default": "./lib/module/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
19
|
+
"default": "./lib/commonjs/index.js"
|
|
20
|
+
}
|
|
13
21
|
},
|
|
14
22
|
"./testing": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
23
|
+
"chipmobilesdk-source": "./src/testing/index.ts",
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./lib/typescript/module/testing/index.d.ts",
|
|
26
|
+
"default": "./lib/module/testing/index.js"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./lib/typescript/commonjs/testing/index.d.ts",
|
|
30
|
+
"default": "./lib/commonjs/testing/index.js"
|
|
31
|
+
}
|
|
18
32
|
}
|
|
19
33
|
},
|
|
20
34
|
"files": [
|
|
@@ -33,22 +47,24 @@
|
|
|
33
47
|
"src/testing",
|
|
34
48
|
"skills",
|
|
35
49
|
"README.md",
|
|
36
|
-
"CHANGELOG.md"
|
|
50
|
+
"CHANGELOG.md",
|
|
51
|
+
"lib"
|
|
37
52
|
],
|
|
38
53
|
"sideEffects": false,
|
|
39
54
|
"scripts": {
|
|
55
|
+
"build": "bob build",
|
|
40
56
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
41
|
-
"pack:check": "npm pack --dry-run"
|
|
57
|
+
"pack:check": "npm pack --dry-run",
|
|
58
|
+
"prepack": "npm run build"
|
|
42
59
|
},
|
|
43
60
|
"dependencies": {
|
|
44
|
-
"@chipmobilesdk/rn-core": "^0.
|
|
61
|
+
"@chipmobilesdk/rn-core": "^0.2.0"
|
|
45
62
|
},
|
|
46
63
|
"peerDependencies": {
|
|
47
|
-
"@dr.pogodin/react-native-fs": "
|
|
48
|
-
"@op-engineering/op-sqlite": "
|
|
49
|
-
"react": ">=19",
|
|
64
|
+
"@dr.pogodin/react-native-fs": "^2.39.2",
|
|
65
|
+
"@op-engineering/op-sqlite": "^17.1.0",
|
|
50
66
|
"react-native": ">=0.85",
|
|
51
|
-
"react-native-quick-crypto": "
|
|
67
|
+
"react-native-quick-crypto": "^1.0.0"
|
|
52
68
|
},
|
|
53
69
|
"peerDependenciesMeta": {
|
|
54
70
|
"react-native-quick-crypto": {
|
|
@@ -58,5 +74,24 @@
|
|
|
58
74
|
"publishConfig": {
|
|
59
75
|
"access": "public",
|
|
60
76
|
"registry": "https://registry.npmjs.org/"
|
|
77
|
+
},
|
|
78
|
+
"react-native-builder-bob": {
|
|
79
|
+
"source": "src",
|
|
80
|
+
"output": "lib",
|
|
81
|
+
"targets": [
|
|
82
|
+
[
|
|
83
|
+
"commonjs",
|
|
84
|
+
{
|
|
85
|
+
"esm": true
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"module",
|
|
90
|
+
{
|
|
91
|
+
"esm": true
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"typescript"
|
|
95
|
+
]
|
|
61
96
|
}
|
|
62
97
|
}
|
|
@@ -41,7 +41,7 @@ section, not by deleting the database file.
|
|
|
41
41
|
`deleteScopeData` and `deleteDatabase` are module-level and do not wait for open
|
|
42
42
|
handles. **After either, open a NEW handle and rebuild everything derived from the
|
|
43
43
|
old one** — repositories, providers, the screen behind a retry button. The old handle
|
|
44
|
-
raises `SCOPE_DELETED` (or `CLOSED_HANDLE` if the app closed it first) on every call,
|
|
44
|
+
is closed for you (its connection and handle slot are released) and raises `SCOPE_DELETED` (or `CLOSED_HANDLE` if the app closed it first) on every call,
|
|
45
45
|
so a Retry wired to it can never succeed: the app stays broken until the process
|
|
46
46
|
restarts. An interrupted deletion instead reports `SCOPE_DELETED` from the next
|
|
47
47
|
`openDatabase` — call `deleteScopeData` again to finish it, then open.
|
package/src/adapter/budgets.ts
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
import { Budgets } from '../contract/config';
|
|
15
15
|
import { DiagnosticCodes } from '../contract/errors';
|
|
16
|
-
import type { StorableRecordData } from '../contract/record';
|
|
17
16
|
import { raise } from '../diagnostics/errors';
|
|
18
17
|
import {
|
|
19
18
|
assertArtifactWithinBudget,
|
|
@@ -53,15 +52,7 @@ export function releaseHandleSlot(): void {
|
|
|
53
52
|
openHandles = Math.max(0, openHandles - 1);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
return openHandles;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** Between tests, and after a `deleteDatabase` that invalidated every handle. */
|
|
55
|
+
/** Between tests. */
|
|
61
56
|
export function resetHandleSlots(): void {
|
|
62
57
|
openHandles = 0;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
|
-
export function assertWritable(collection: string, data: StorableRecordData): void {
|
|
66
|
-
assertRecordWithinBudget(collection, data);
|
|
67
|
-
}
|
|
@@ -27,18 +27,12 @@ import { decodeCursor } from '../query/cursor';
|
|
|
27
27
|
import { buildPage, fetchLimitFor, resolvePageSize } from '../query/paginate';
|
|
28
28
|
import { withStableTiebreaker } from '../query/sort';
|
|
29
29
|
import { validateQuery } from '../query/validate';
|
|
30
|
-
import { collectionTable, hasSoftDelete
|
|
30
|
+
import { collectionTable, hasSoftDelete } from '../schema/declare';
|
|
31
31
|
import type { Executor } from '../sqlite/connection';
|
|
32
32
|
import type { SqlValue } from '../sqlite/native';
|
|
33
|
-
import {
|
|
34
|
-
decodeRow,
|
|
35
|
-
encodePayload,
|
|
36
|
-
insertColumns,
|
|
37
|
-
projectedColumnNames,
|
|
38
|
-
projectedValues,
|
|
39
|
-
updateAssignments,
|
|
40
|
-
} from '../sqlite/row-codec';
|
|
33
|
+
import { decodeRow } from '../sqlite/row-codec';
|
|
41
34
|
import { buildFilter, buildKeysetPredicate, buildOrderBy } from '../sqlite/sql-builder';
|
|
35
|
+
import { insertStatement, updateStatement } from '../sqlite/statements';
|
|
42
36
|
import { assertRecordWithinBudget } from './budgets';
|
|
43
37
|
|
|
44
38
|
export type SqlCollectionContext = {
|
|
@@ -83,44 +77,35 @@ export function createSqlCollection<T extends StorableRecordData>(
|
|
|
83
77
|
async insert(record: RecordInput<T>): Promise<WriteOutcome> {
|
|
84
78
|
context.assertUsable();
|
|
85
79
|
throwIfFaulted('write');
|
|
86
|
-
assertRecordWithinBudget(schema.name, record.data);
|
|
80
|
+
const payload = assertRecordWithinBudget(schema.name, record.data);
|
|
87
81
|
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
|
|
82
|
+
// One statement: a row that is already there is left untouched and
|
|
83
|
+
// reported, instead of a SELECT first and an INSERT after (LDB-08). The
|
|
84
|
+
// failure stays boring — nothing was written, and no engine error
|
|
85
|
+
// surfaces from inside a transaction.
|
|
86
|
+
const result = await context
|
|
87
|
+
.executor()
|
|
88
|
+
.execute(
|
|
89
|
+
...insertStatement(schema, record.id, record.data, context.now(), payload, 'ignore'),
|
|
90
|
+
);
|
|
91
|
+
if (result.rowsAffected === 0) {
|
|
93
92
|
raise(DiagnosticCodes.RECORD_CONFLICT, {
|
|
94
93
|
message: 'record already exists',
|
|
95
94
|
detail: { collection: schema.name, recordId: record.id },
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
|
-
|
|
99
|
-
const { columns, values } = insertColumns(schema, record.id, record.data, context.now());
|
|
100
|
-
await context
|
|
101
|
-
.executor()
|
|
102
|
-
.execute(
|
|
103
|
-
`INSERT INTO ${table} (${columns.map(name => `"${name}"`).join(', ')}) VALUES (${columns
|
|
104
|
-
.map(() => '?')
|
|
105
|
-
.join(', ')})`,
|
|
106
|
-
values,
|
|
107
|
-
);
|
|
108
97
|
return { operation: 'created', id: record.id };
|
|
109
98
|
},
|
|
110
99
|
|
|
111
100
|
async update(id, record): Promise<WriteOutcome> {
|
|
112
101
|
context.assertUsable();
|
|
113
102
|
throwIfFaulted('write');
|
|
114
|
-
assertRecordWithinBudget(schema.name, record.data);
|
|
103
|
+
const payload = assertRecordWithinBudget(schema.name, record.data);
|
|
115
104
|
|
|
116
|
-
const { columns, values } = updateAssignments(schema, record.data, context.now());
|
|
117
105
|
const result = await context
|
|
118
106
|
.executor()
|
|
119
107
|
.execute(
|
|
120
|
-
|
|
121
|
-
.map(name => `"${name}" = ?`)
|
|
122
|
-
.join(', ')} WHERE id = ? AND ${LIVE}`,
|
|
123
|
-
[...values, id],
|
|
108
|
+
...updateStatement(schema, id, record.data, context.now(), payload, { liveOnly: true }),
|
|
124
109
|
);
|
|
125
110
|
if (result.rowsAffected === 0) {
|
|
126
111
|
// Creating the record instead would be a silent write to an id
|
|
@@ -133,47 +118,34 @@ export function createSqlCollection<T extends StorableRecordData>(
|
|
|
133
118
|
async upsert(record: RecordInput<T>): Promise<WriteOutcome> {
|
|
134
119
|
context.assertUsable();
|
|
135
120
|
throwIfFaulted('write');
|
|
136
|
-
assertRecordWithinBudget(schema.name, record.data);
|
|
137
|
-
|
|
138
|
-
const existed = (await rowById(record.id, true)) !== undefined;
|
|
121
|
+
const payload = assertRecordWithinBudget(schema.name, record.data);
|
|
139
122
|
const now = context.now();
|
|
140
123
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
assignments.push('updated_at = ?');
|
|
146
|
-
values.push(now);
|
|
147
|
-
}
|
|
148
|
-
if (hasSoftDelete(schema)) {
|
|
149
|
-
// An upsert over a soft-deleted record brings it back: the
|
|
150
|
-
// caller asked for this id to hold this data.
|
|
151
|
-
assignments.push('deleted_at = NULL');
|
|
152
|
-
}
|
|
153
|
-
const projected = projectedValues(schema, record.data);
|
|
154
|
-
for (const [index, name] of projectedColumnNames(schema).entries()) {
|
|
155
|
-
assignments.push(`"${name}" = ?`);
|
|
156
|
-
values.push(projected[index]!);
|
|
157
|
-
}
|
|
158
|
-
await context
|
|
124
|
+
// An upsert over a soft-deleted record brings it back: the caller
|
|
125
|
+
// asked for this id to hold this data.
|
|
126
|
+
const update = async (): Promise<boolean> => {
|
|
127
|
+
const result = await context
|
|
159
128
|
.executor()
|
|
160
|
-
.execute(
|
|
161
|
-
...
|
|
162
|
-
|
|
163
|
-
|
|
129
|
+
.execute(
|
|
130
|
+
...updateStatement(schema, record.id, record.data, now, payload, { restore: true }),
|
|
131
|
+
);
|
|
132
|
+
return result.rowsAffected > 0;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// The update is tried first: one round-trip for a record that exists,
|
|
136
|
+
// with no SELECT before it (LDB-08).
|
|
137
|
+
if (await update()) {
|
|
164
138
|
return { operation: 'updated', id: record.id };
|
|
165
139
|
}
|
|
166
|
-
|
|
167
|
-
const { columns, values } = insertColumns(schema, record.id, record.data, now);
|
|
168
|
-
await context
|
|
140
|
+
const inserted = await context
|
|
169
141
|
.executor()
|
|
170
|
-
.execute(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return { operation: '
|
|
142
|
+
.execute(...insertStatement(schema, record.id, record.data, now, payload, 'ignore'));
|
|
143
|
+
if (inserted.rowsAffected > 0) {
|
|
144
|
+
return { operation: 'created', id: record.id };
|
|
145
|
+
}
|
|
146
|
+
// Another write created the row between the two statements.
|
|
147
|
+
await update();
|
|
148
|
+
return { operation: 'updated', id: record.id };
|
|
177
149
|
},
|
|
178
150
|
|
|
179
151
|
async get(id: string): Promise<StoredRecord<T>> {
|
package/src/adapter/deletion.ts
CHANGED
|
@@ -60,6 +60,51 @@ export function isScopeInvalidated(name: string, scopeKey: string): boolean {
|
|
|
60
60
|
|
|
61
61
|
export function clearAllInvalidations(): void {
|
|
62
62
|
invalidated.clear();
|
|
63
|
+
openHandles.clear();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Handles open on a scope, so a deletion can take their connection away
|
|
68
|
+
* (LDB-14). Marking alone left the native connection and its handle slot held
|
|
69
|
+
* until the app closed a handle it had been told was dead: eight sign-outs
|
|
70
|
+
* later every open failed, with the unlinked file still pinned by its
|
|
71
|
+
* descriptor.
|
|
72
|
+
*/
|
|
73
|
+
const openHandles = new Map<string, Set<() => Promise<void>>>();
|
|
74
|
+
|
|
75
|
+
/** Returns the function that takes the handle out of the registry again. */
|
|
76
|
+
export function registerOpenHandle(
|
|
77
|
+
name: string,
|
|
78
|
+
scopeKey: string,
|
|
79
|
+
revoke: () => Promise<void>,
|
|
80
|
+
): () => void {
|
|
81
|
+
const key = invalidationKey(name, scopeKey);
|
|
82
|
+
const handles = openHandles.get(key) ?? new Set();
|
|
83
|
+
handles.add(revoke);
|
|
84
|
+
openHandles.set(key, handles);
|
|
85
|
+
return () => {
|
|
86
|
+
handles.delete(revoke);
|
|
87
|
+
if (handles.size === 0) {
|
|
88
|
+
openHandles.delete(key);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Every handle on the scope, or on any scope of the database when none is named. */
|
|
94
|
+
async function revokeHandles(name: string, scopeKey?: string): Promise<void> {
|
|
95
|
+
const prefix = `${name}:`;
|
|
96
|
+
for (const [key, handles] of [...openHandles]) {
|
|
97
|
+
const matches =
|
|
98
|
+
scopeKey === undefined ? key.startsWith(prefix) : key === invalidationKey(name, scopeKey);
|
|
99
|
+
if (!matches) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
openHandles.delete(key);
|
|
103
|
+
for (const revoke of handles) {
|
|
104
|
+
// A connection that will not close does not get to stop a deletion.
|
|
105
|
+
await revoke().catch(() => undefined);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
63
108
|
}
|
|
64
109
|
|
|
65
110
|
/** Deleting a scope that holds nothing is success, not an error (FR-062). */
|
|
@@ -144,6 +189,8 @@ async function removeScope(config: ScopeTargetConfig): Promise<DeletionOutcome>
|
|
|
144
189
|
await markDeleting(catalog, scope.key);
|
|
145
190
|
}
|
|
146
191
|
markScopeInvalidated(config.name, scope.key);
|
|
192
|
+
// Before the files go: a connection still open on them pins them.
|
|
193
|
+
await revokeHandles(config.name, scope.key);
|
|
147
194
|
|
|
148
195
|
const removedArtifacts = await artifactIdsOnDisk(layout, scope.key);
|
|
149
196
|
|
|
@@ -241,6 +288,7 @@ export async function deleteDatabase(config: DatabaseTargetConfig): Promise<Dele
|
|
|
241
288
|
for (const scopeKey of scopeKeys) {
|
|
242
289
|
markScopeInvalidated(config.name, scopeKey);
|
|
243
290
|
}
|
|
291
|
+
await revokeHandles(config.name);
|
|
244
292
|
|
|
245
293
|
const removed = await removeIfPresent(layout.root);
|
|
246
294
|
return {
|