Skip to content

Commit

Permalink
Import byteBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastijankuzner committed Jan 9, 2025
1 parent c864276 commit bc5bd22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"lmdb": "3.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/database/source/database-service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { inject, injectable } from "@mainsail/container";
import { Contracts, Identifiers } from "@mainsail/contracts";
import { Utils } from "@mainsail/kernel";
import { ByteBuffer } from "@mainsail/utils";
import type { Database, RootDatabase } from "lmdb";
import { ByteBuffer } from "packages/utils/distribution/byte-buffer.js";

@injectable()
export class DatabaseService implements Contracts.Database.DatabaseService {
Expand Down Expand Up @@ -186,7 +186,7 @@ export class DatabaseService implements Contracts.Database.DatabaseService {
return undefined;
}

const transactionBytes: Buffer | undefined = this.transactionStorage.get(id);
const transactionBytes: Buffer | undefined = this.transactionStorage.get(key);
Utils.assert.defined<Buffer>(transactionBytes);

return await this.transactionFactory.fromBytes(transactionBytes.subarray(8));
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc5bd22

Please sign in to comment.