Skip to content

Commit

Permalink
feat: adds entity-schema support for withoutRowid (#8432)
Browse files Browse the repository at this point in the history
Closes: #8429

Co-authored-by: Thrasher <thrasher@grayshift.com>
  • Loading branch information
pthrasher and Thrasher committed Dec 10, 2021
1 parent 2bf93d4 commit bd22dc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/entity-schema/EntitySchemaOptions.ts
Expand Up @@ -94,6 +94,13 @@ export class EntitySchemaOptions<T> {
*/
synchronize?: boolean;

/**
* If set to 'true' this option disables Sqlite's default behaviour of secretly creating
* an integer primary key column named 'rowid' on table creation.
* @see https://www.sqlite.org/withoutrowid.html.
*/
withoutRowid?: boolean;

/**
* View expression.
*/
Expand Down
1 change: 1 addition & 0 deletions src/entity-schema/EntitySchemaTransformer.ts
Expand Up @@ -42,6 +42,7 @@ export class EntitySchemaTransformer {
type: options.type || "regular",
orderBy: options.orderBy,
synchronize: options.synchronize,
withoutRowid: !!options.withoutRowid,
expression: options.expression
};
metadataArgsStorage.tables.push(tableMetadata);
Expand Down

0 comments on commit bd22dc3

Please sign in to comment.