Skip to content

Commit

Permalink
feat: adding transactions support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcs-alejandro committed Feb 12, 2024
1 parent 369c827 commit d4b6f30
Show file tree
Hide file tree
Showing 24 changed files with 926 additions and 36 deletions.
2 changes: 1 addition & 1 deletion __test__/handler-remove-many.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Test Document Remove Many', () => {
const Cat = model('Cat', CatSchema);
const metadata = getModelMetadata(Cat);
try {
await removeCallback('dummy_id', metadata);
await removeCallback('dummy_id', metadata, {}, {});
} catch (err) {
const error = err as StatusExecution;
const dnf = new DocumentNotFoundError();
Expand Down
10 changes: 9 additions & 1 deletion __test__/testData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ottoman, SearchConsistency } from '../src';
import { LogicalWhereExpr, Ottoman, SearchConsistency, FindOptions, ModelTypes } from '../src';

export const bucketName = 'travel-sample';
export const username = 'Administrator';
Expand All @@ -18,4 +18,12 @@ export const startInTest = async (ottoman: Ottoman): Promise<boolean> => {
return true;
};

export const cleanUp = <T = any>(
model: ModelTypes<T>,
query: LogicalWhereExpr<T> = { _type: model.collectionName },
options: FindOptions = { consistency: SearchConsistency.LOCAL },
) => {
return model.removeMany(query, options);
};

export const consistency = { consistency: SearchConsistency.LOCAL };
Loading

0 comments on commit d4b6f30

Please sign in to comment.