-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Configurable Web VFS (added OPFS) (#418)
Co-authored-by: Christiaan Landman <chriz.ek@gmail.com> Co-authored-by: Mughees Khan <mugi@journeyapps.com>
- Loading branch information
1 parent
e79ed9b
commit 065aba6
Showing
29 changed files
with
3,038 additions
and
1,179 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@powersync/web': minor | ||
--- | ||
|
||
Added support for OPFS virtual filesystem. |
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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { BatchedUpdateNotification, QueryResult } from '@powersync/common'; | ||
import { ResolvedWebSQLOpenOptions } from './web-sql-flags'; | ||
|
||
/** | ||
* Proxied query result does not contain a function for accessing row values | ||
*/ | ||
export type ProxiedQueryResult = Omit<QueryResult, 'rows'> & { | ||
rows: { | ||
_array: any[]; | ||
length: number; | ||
}; | ||
}; | ||
export type OnTableChangeCallback = (event: BatchedUpdateNotification) => void; | ||
|
||
/** | ||
* @internal | ||
* An async Database connection which provides basic async SQL methods. | ||
* This is usually a proxied through a web worker. | ||
*/ | ||
export interface AsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOptions = ResolvedWebSQLOpenOptions> { | ||
init(): Promise<void>; | ||
close(): Promise<void>; | ||
execute(sql: string, params?: any[]): Promise<ProxiedQueryResult>; | ||
executeBatch(sql: string, params?: any[]): Promise<ProxiedQueryResult>; | ||
registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void>; | ||
getConfig(): Promise<Config>; | ||
} | ||
|
||
export type OpenAsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOptions = ResolvedWebSQLOpenOptions> = ( | ||
config: Config | ||
) => AsyncDatabaseConnection; |
Oops, something went wrong.