Skip to content

Commit 2d0acae

Browse files
committed
Make Sqlite options and types readonly
Updated SqliteDriverOptions, SqlIdentifier, and RawSql interfaces to use readonly properties for improved type safety. Also corrected the SafeSql brand type name.
1 parent 5b080b6 commit 2d0acae

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

packages/common/src/Sqlite.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export interface CreateSqliteDriverDep {
3535
}
3636

3737
export interface SqliteDriverOptions {
38-
memory?: boolean;
39-
encryptionKey?: EncryptionKey | undefined;
38+
readonly memory?: boolean;
39+
readonly encryptionKey?: EncryptionKey | undefined;
4040
}
4141

4242
/**
@@ -76,7 +76,7 @@ export interface SqliteQuery {
7676
}
7777

7878
/** A type representing a sanitized SQL string. */
79-
export type SafeSql = string & Brand<"TimestampString">;
79+
export type SafeSql = string & Brand<"SafeSql">;
8080

8181
/**
8282
* A value that can be stored in Sqlite.
@@ -303,13 +303,13 @@ export const createPreparedStatementsCache = <P>(
303303
};
304304

305305
export interface SqlIdentifier {
306-
type: "SqlIdentifier";
307-
sql: SafeSql;
306+
readonly type: "SqlIdentifier";
307+
readonly sql: SafeSql;
308308
}
309309

310310
export interface RawSql {
311-
type: "RawSql";
312-
sql: string;
311+
readonly type: "RawSql";
312+
readonly sql: string;
313313
}
314314

315315
export type SqlTemplateParam = SqliteValue | SqlIdentifier | RawSql;

0 commit comments

Comments
 (0)