Skip to content

Commit b81ee14

Browse files
committed
Make RawTable type internal
1 parent cbb320c commit b81ee14

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

packages/common/src/db/schema/RawTable.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import { TableOrRawTableOptions } from './Table.js';
22

33
/**
4-
* A pending variant of a {@link RawTable} that doesn't have a name (because it would be inferred when creating the
5-
* schema).
4+
* Instructs PowerSync to sync data into a "raw" table.
5+
*
6+
* Since raw tables are not backed by JSON, running complex queries on them may be more efficient. Further, they allow
7+
* using client-side table and column constraints.
8+
*
9+
* To collect local writes to raw tables with PowerSync, custom triggers are required. See
10+
* {@link https://docs.powersync.com/usage/use-case-examples/raw-tables the documentation} for details and an example on
11+
* using raw tables.
12+
*
13+
* Note that raw tables are only supported when using the new `SyncClientImplementation.rust` sync client.
14+
*
15+
* @experimental Please note that this feature is experimental at the moment, and not covered by PowerSync semver or
16+
* stability guarantees.
617
*/
718
export type RawTableType = RawTableTypeWithStatements | InferredRawTableType;
819

@@ -64,19 +75,7 @@ export type PendingStatement = {
6475
};
6576

6677
/**
67-
* Instructs PowerSync to sync data into a "raw" table.
68-
*
69-
* Since raw tables are not backed by JSON, running complex queries on them may be more efficient. Further, they allow
70-
* using client-side table and column constraints.
71-
*
72-
* To collect local writes to raw tables with PowerSync, custom triggers are required. See
73-
* {@link https://docs.powersync.com/usage/use-case-examples/raw-tables the documentation} for details and an example on
74-
* using raw tables.
75-
*
76-
* Note that raw tables are only supported when using the new `SyncClientImplementation.rust` sync client.
77-
*
78-
* @experimental Please note that this feature is experimental at the moment, and not covered by PowerSync semver or
79-
* stability guarantees.
78+
* @internal
8079
*/
8180
export type RawTable<T extends RawTableType = RawTableType> = T & {
8281
/**

packages/common/src/db/schema/Schema.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ export class Schema<S extends SchemaType = SchemaType> {
5858
*/
5959
withRawTables(tables: Record<string, RawTableType>) {
6060
for (const [name, rawTableDefinition] of Object.entries(tables)) {
61-
if ('name' in rawTableDefinition) {
62-
this.rawTables.push(rawTableDefinition as RawTable);
63-
} else {
64-
this.rawTables.push({ name, ...rawTableDefinition });
65-
}
61+
this.rawTables.push({ name, ...rawTableDefinition });
6662
}
6763
}
6864

packages/common/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export * from './db/DBAdapter.js';
3939
export * from './db/schema/Column.js';
4040
export * from './db/schema/Index.js';
4141
export * from './db/schema/IndexedColumn.js';
42-
export * from './db/schema/RawTable.js';
42+
export { RawTableType, PendingStatementParameter, PendingStatement } from './db/schema/RawTable.js';
4343
export * from './db/schema/Schema.js';
4444
export * from './db/schema/Table.js';
4545
export * from './db/schema/TableV2.js';

0 commit comments

Comments
 (0)