Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/curly-bugs-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/web': minor
---

Export AsyncDatabaseConnection (and related) types for internal use
8 changes: 8 additions & 0 deletions packages/web/src/db/adapters/AsyncDatabaseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BatchedUpdateNotification, QueryResult } from '@powersync/common';
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';

/**
* @internal
* Proxied query result does not contain a function for accessing row values
*/
export type ProxiedQueryResult = Omit<QueryResult, 'rows'> & {
Expand All @@ -10,6 +11,10 @@ export type ProxiedQueryResult = Omit<QueryResult, 'rows'> & {
length: number;
};
};

/**
* @internal
*/
export type OnTableChangeCallback = (event: BatchedUpdateNotification) => void;

/**
Expand All @@ -27,6 +32,9 @@ export interface AsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOption
getConfig(): Promise<Config>;
}

/**
* @internal
*/
export type OpenAsyncDatabaseConnection<Config extends ResolvedWebSQLOpenOptions = ResolvedWebSQLOpenOptions> = (
config: Config
) => AsyncDatabaseConnection;
1 change: 1 addition & 0 deletions packages/web/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from '@powersync/common';
export * from './db/adapters/AsyncDatabaseConnection';
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory';
export * from './db/adapters/AbstractWebSQLOpenFactory';
export * from './db/adapters/wa-sqlite/WASQLiteConnection';
Expand Down