Skip to content

Commit 292e73d

Browse files
committed
Fix type issues
1 parent dc50d24 commit 292e73d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/lib/sqlite-gen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface TypeSchema {
1818
properties?: Record<string, SchemaProperty>;
1919
}
2020

21-
interface Record {
21+
interface DataRecord {
2222
recordId: string;
2323
type: string;
2424
data: unknown;
@@ -79,7 +79,7 @@ export function generateAllDDL(schemas: Record<string, TypeSchema>): string {
7979
*/
8080
export function buildSqliteBuffer(
8181
schemas: Record<string, TypeSchema>,
82-
records: Record[],
82+
records: DataRecord[],
8383
): Buffer {
8484
const db = new Database(":memory:");
8585

@@ -90,7 +90,7 @@ export function buildSqliteBuffer(
9090
}
9191

9292
// Insert records grouped by type
93-
const byType = new Map<string, Record[]>();
93+
const byType = new Map<string, DataRecord[]>();
9494
for (const rec of records) {
9595
const arr = byType.get(rec.type) ?? [];
9696
arr.push(rec);
@@ -108,7 +108,7 @@ export function buildSqliteBuffer(
108108
`INSERT OR IGNORE INTO ${ident(typeName)} (${colNames}) VALUES (${placeholders})`,
109109
);
110110

111-
const insertMany = db.transaction((recs: Record[]) => {
111+
const insertMany = db.transaction((recs: DataRecord[]) => {
112112
for (const rec of recs) {
113113
const data = rec.data as any;
114114
const values = [

src/sql-js.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'sql.js';

0 commit comments

Comments
 (0)