Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the CI/CD flow and branching #56

Merged
merged 29 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7ebadad
Added streaming feature to the kubo
magestrio Oct 25, 2023
218a93c
Initial changes for merkle streaming
magestrio Oct 24, 2023
9c944c5
- Changed the streaming approach. Now each chunk consists
magestrio Oct 28, 2023
78a7341
Remove helia ipfs implementation
chiro-hiro Sep 23, 2023
3cbc01c
Add memory storage engine for testing
chiro-hiro Sep 24, 2023
21fa0ed
Merge pull request #45 from orochi-network/feature/merkle_stream
chiro-hiro Oct 29, 2023
afbe8cc
Initial zkDatabase as a service
chiro-hiro Oct 29, 2023
8750621
Add main program
chiro-hiro Oct 29, 2023
eac5098
Add abstract data engine
chiro-hiro Oct 29, 2023
8ebb4e1
Add collection model
chiro-hiro Oct 29, 2023
48711ec
Add database model
chiro-hiro Oct 29, 2023
25f1015
Add document model
chiro-hiro Oct 29, 2023
290160a
Add helper for service
chiro-hiro Oct 29, 2023
3bd0967
Apollo applications
chiro-hiro Oct 29, 2023
6ea9c94
Update package-lock.js
chiro-hiro Oct 29, 2023
3e12a08
Initialize test structure (#44)
magestrio Oct 29, 2023
d2a700a
Add missing implementations to apollo server
chiro-hiro Oct 31, 2023
09cb8c9
Fix incompatible in
chiro-hiro Nov 3, 2023
58e511c
Update application and remove drop() method
chiro-hiro Nov 3, 2023
03a2dce
Merge branch 'development' into feature/zkdb_as_a_service
chiro-hiro Nov 10, 2023
d37e0e3
Merge pull request #47 from orochi-network/feature/zkdb_as_a_service
chiro-hiro Nov 10, 2023
8122efa
Merge pull request #46 from orochi-network/feature/kubo-streaming
chiro-hiro Dec 11, 2023
a67719a
- fixed issues
magestrio Oct 29, 2023
49278f9
Use UInt8Array instead of Buffer
magestrio Dec 8, 2023
621bd3b
Merge pull request #48 from orochi-network/feature/merkle-tree-stream…
magestrio Dec 12, 2023
5666758
Merge branch 'main' into development
chiro-hiro Dec 13, 2023
cdd3dc4
Fix all lint and test issues
chiro-hiro Dec 13, 2023
6c5d8dc
Fix format error
chiro-hiro Dec 13, 2023
e2f5a36
Remove unnecessary consolse.log()
chiro-hiro Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add collection model
  • Loading branch information
chiro-hiro committed Oct 29, 2023
commit 8ebb4e1dd3fe31ed893f69dd1a9f17e3d466a616
56 changes: 56 additions & 0 deletions packages/serverless/src/model/collection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { CreateIndexesOptions, IndexSpecification } from 'mongodb';
import { ModelBasic } from './abstract/basic';
import { ModelDocument } from './document';

export class ModelCollection extends ModelBasic {
private constructor(databaseName: string, collectionName: string) {
super(databaseName, collectionName);
}

public static getInstance(databaseName: string, collectionName: string) {
return new ModelCollection(databaseName, collectionName);
}

public getDocument() {
return ModelDocument.getInstance(this.databaseName!, this.collectionName!);
}

public async create(
indexSpecs: IndexSpecification,
indexOptions?: CreateIndexesOptions
) {
await this.collection.createIndex(indexSpecs, indexOptions);
}

public async drop() {
return this.db.dropCollection(this.collectionName!);
}

public async list() {
return this.db.listCollections();
}

public async index(
indexSpec: IndexSpecification,
indexOptions?: CreateIndexesOptions
) {
return this.collection.createIndex(indexSpec, indexOptions);
}

public async isIndexed(indexName: string): Promise<boolean> {
for await (const index of this.collection.listIndexes()) {
if (index.name === indexName) {
return true;
}
}
return false;
}

public async dropIndex(indexName: string) {
return this.collection.dropIndex(indexName);
}

public async listIndexes() {
return this.collection.listIndexes();
}
}