-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add transaction signature bytes. Handled corrupted DB. Ensure open da…
…tabase on all operations. Improve docs. Add method listKeys.
- Loading branch information
Showing
12 changed files
with
415 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,10 @@ bunfig.toml | |
|
||
# Local | ||
lab/ | ||
local/ | ||
lab.ts | ||
local.ts | ||
mydatabase*/ | ||
stress-test/ | ||
|
||
# Pup data | ||
.pup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export { KV, type KVOptions } from "./src/kv.ts"; | ||
export { | ||
KV, | ||
type KVOptions, | ||
type KVSyncResult, | ||
type KVSyncResultStatus, | ||
} from "./src/kv.ts"; | ||
export type { KVKey, KVQuery, KVQueryRange } from "./src/key.ts"; | ||
export type { KVOperation, KVTransactionResult } from "./src/transaction.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
// Configurable | ||
export const LOCK_DEFAULT_MAX_RETRIES = 32; | ||
export const LOCK_DEFAULT_INITIAL_RETRY_INTERVAL_MS = 20; // Increased with itself on each retry, so the actual retry interval is 20, 40, 60 etc. 32 and 20 become about 10 seconds total. | ||
export const LOCK_STALE_TIMEOUT_S = 60_000; | ||
export const LOCK_DEFAULT_INITIAL_RETRY_INTERVAL_MS = 30; // Increased with itself on each retry, so the actual retry interval is 20, 40, 60 etc. 32 and 20 become about 10 seconds total. | ||
export const LOCK_STALE_TIMEOUT_MS = 60_000; | ||
export const LEDGER_CURRENT_VERSION: string = "BETA"; | ||
export const SUPPORTED_LEDGER_VERSIONS: string[] = [ | ||
"ALPH", | ||
LEDGER_CURRENT_VERSION, | ||
]; | ||
export const LEDGER_MAX_READ_FAILURES = 10; | ||
export const LEDGER_PREFETCH_BYTES = 2_048; | ||
export const SYNC_INTERVAL_MS = 1_000; // Overridable with instance configuration | ||
export const SYNC_INTERVAL_MS = 2_500; // Overridable with instance configuration | ||
|
||
// Extremely constant | ||
export const LEDGER_BASE_OFFSET = 1_024; // DO NOT CHANGE! | ||
export const KV_KEY_ALLOWED_CHARS = /^[a-zA-Z0-9\-_@]+$/; | ||
export const LEDGER_FILE_ID: string = "CKVD"; // Cross/KV Database | ||
export const TRANSACTION_SIGNATURE: string = "CKT"; // Cross/Kv Transaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.