-
Notifications
You must be signed in to change notification settings - Fork 1
Vector DB #1197
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
Open
astrimaitis
wants to merge
10
commits into
develop
Choose a base branch
from
vector-attempt-2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vector DB #1197
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
09d6375
init
astrimaitis 592eeba
remove packages
astrimaitis ad2ecfe
yarn
astrimaitis 1e792df
push
astrimaitis 8a7f82e
lockfile compile issue
astrimaitis 39f442a
add vector-db to dockerfile
astrimaitis 43d4f40
Merge branch 'develop' into vector-attempt-2
astrimaitis bef0c6f
address comments
astrimaitis ac55db4
tests pass
astrimaitis c6519b9
replace any
astrimaitis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -40,6 +40,9 @@ | |
| }, | ||
| { | ||
| "path": "../signatureVerification" | ||
| }, | ||
| { | ||
| "path": "../vector-db" | ||
| } | ||
| ], | ||
| "include": [ | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export interface KMeansResult { | ||
| clusters: number[]; | ||
| centroids: number[][]; // { centroid: number[], error: number, size: number }[], | ||
| converged: boolean; | ||
| iterations: number; | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| import { ResultAsync } from "neverthrow"; | ||
|
|
||
| import { | ||
| VersionedObject, | ||
| VolatileStorageMetadata, | ||
| } from "@objects/businessObjects"; | ||
| import { PersistenceError } from "@objects/errors"; | ||
| import { IVolatileCursor } from "@objects/interfaces"; | ||
| import { VolatileStorageKey } from "@objects/primitives"; | ||
|
|
||
| export interface IIndexedDB { | ||
| initialize(): ResultAsync<IDBDatabase, PersistenceError>; | ||
| close(): ResultAsync<void, PersistenceError>; | ||
| persist(): ResultAsync<boolean, PersistenceError>; | ||
| clear(): ResultAsync<void, PersistenceError>; | ||
| clearObjectStore(name: string): ResultAsync<void, PersistenceError>; | ||
| putObject<T>(name: string, obj: T): ResultAsync<void, PersistenceError>; | ||
| removeObject<T extends VersionedObject>( | ||
| name: string, | ||
| key: string, | ||
| ): ResultAsync<VolatileStorageMetadata<T> | null, PersistenceError>; | ||
|
|
||
| getObject<T extends VersionedObject>( | ||
| name: string, | ||
| key: VolatileStorageKey, | ||
| _includeDeleted?: boolean, | ||
| ): ResultAsync<VolatileStorageMetadata<T> | null, PersistenceError>; | ||
|
|
||
| getCursor<T extends VersionedObject>( | ||
| name: string, | ||
| index?: VolatileStorageKey, | ||
| query?: string | number, | ||
| direction?: IDBCursorDirection | undefined, | ||
| mode?: IDBTransactionMode, | ||
| ): ResultAsync<IVolatileCursor<T>, PersistenceError>; | ||
|
|
||
| deleteDatabase(database: string): ResultAsync<void, PersistenceError>; | ||
|
|
||
| getAll<T extends VersionedObject>( | ||
| storeName: string, | ||
| ): ResultAsync<VolatileStorageMetadata<T>[], PersistenceError>; | ||
|
|
||
| getAllByIndex<T extends VersionedObject>( | ||
| name: string, | ||
| index: VolatileStorageKey, | ||
| query: IDBValidKey | IDBKeyRange, | ||
| ): ResultAsync<VolatileStorageMetadata<T>[], PersistenceError>; | ||
|
|
||
| getAllKeys<T>( | ||
| name: string, | ||
| index?: VolatileStorageKey, | ||
| query?: IDBValidKey | IDBKeyRange, | ||
| count?: number | undefined, | ||
| ): ResultAsync<T[], PersistenceError>; | ||
|
|
||
| get<T extends VersionedObject>( | ||
| name: string, | ||
| { | ||
| index, | ||
| query, | ||
| count, | ||
| id, | ||
| }: { | ||
| index?: string; | ||
| query?: IDBValidKey | IDBKeyRange | null; | ||
| count?: number; | ||
| id?: IDBValidKey; | ||
| }, | ||
| ): ResultAsync<VolatileStorageMetadata<T>[], PersistenceError>; | ||
|
|
||
| getKeys( | ||
| name: string, | ||
| { | ||
| index, | ||
| query, | ||
| count, | ||
| }: { | ||
| index?: string; | ||
| query?: IDBValidKey | IDBKeyRange | null; | ||
| count?: number; | ||
| }, | ||
| ): ResultAsync<IDBValidKey[], PersistenceError>; | ||
|
|
||
| getCursor2<T extends VersionedObject>( | ||
| name: string, | ||
| { | ||
| index, | ||
| query, | ||
| lowerCount, | ||
| upperCount, | ||
| latest, | ||
| }: { | ||
| index?: string; | ||
| query?: IDBValidKey | IDBKeyRange | null; | ||
| lowerCount?: number; | ||
| upperCount?: number; | ||
| latest?: boolean; | ||
| }, | ||
| ): ResultAsync<VolatileStorageMetadata<T>[], PersistenceError>; | ||
|
|
||
| countRecords( | ||
| name: string, | ||
| { | ||
| index, | ||
| query, | ||
| }: { | ||
| index?: string; | ||
| query?: IDBValidKey | IDBKeyRange | undefined; | ||
| }, | ||
| ): ResultAsync<number, PersistenceError>; | ||
|
|
||
| getKey<T extends VersionedObject>( | ||
| tableName: string, | ||
| obj: VolatileStorageMetadata<T>, | ||
| ): ResultAsync<VolatileStorageKey | null, PersistenceError>; | ||
| } | ||
|
|
||
| export const IIndexedDBType = Symbol.for("IIndexedDB"); |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { ResultAsync } from "neverthrow"; | ||
|
|
||
| import { | ||
| VolatileStorageMetadata, | ||
| VersionedObject, | ||
| } from "@objects/businessObjects"; | ||
| import { PersistenceError } from "@objects/errors"; | ||
|
|
||
| export interface IVolatileCursor<T extends VersionedObject> { | ||
| nextValue(): ResultAsync<T | null, PersistenceError>; | ||
| allValues(): ResultAsync<T[] | null, PersistenceError>; | ||
|
|
||
| _next(): ResultAsync<VolatileStorageMetadata<T> | null, PersistenceError>; | ||
| _all(): ResultAsync<VolatileStorageMetadata<T>[], PersistenceError>; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.