aboutsummaryrefslogtreecommitdiff
path: root/packages/db/src/core/queries.ts
diff options
context:
space:
mode:
authorGravatar Darius <19603573+itsMapleLeaf@users.noreply.github.com> 2024-08-08 05:12:50 -0500
committerGravatar GitHub <noreply@github.com> 2024-08-08 12:12:50 +0200
commit72c7ae9901de927ae8d9d5be63cbaef4f976422c (patch)
tree6e41a6b07ad8830375ba7b0e4d924fd9449dc7ef /packages/db/src/core/queries.ts
parent85de47cd982fd13c6286bcc0be384a220996ccbd (diff)
downloadastro-72c7ae9901de927ae8d9d5be63cbaef4f976422c.tar.gz
astro-72c7ae9901de927ae8d9d5be63cbaef4f976422c.tar.zst
astro-72c7ae9901de927ae8d9d5be63cbaef4f976422c.zip
update formatter config (#11640)
* update formatter config * format --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Diffstat (limited to 'packages/db/src/core/queries.ts')
-rw-r--r--packages/db/src/core/queries.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/db/src/core/queries.ts b/packages/db/src/core/queries.ts
index 70ea0cf0e..705205ee4 100644
--- a/packages/db/src/core/queries.ts
+++ b/packages/db/src/core/queries.ts
@@ -33,14 +33,14 @@ export function getCreateTableQuery(tableName: string, table: DBTable) {
const colQueries = [];
const colHasPrimaryKey = Object.entries(table.columns).find(([, column]) =>
- hasPrimaryKey(column)
+ hasPrimaryKey(column),
);
if (!colHasPrimaryKey) {
colQueries.push('_id INTEGER PRIMARY KEY');
}
for (const [columnName, column] of Object.entries(table.columns)) {
const colQuery = `${sqlite.escapeName(columnName)} ${schemaTypeToSqlType(
- column.type
+ column.type,
)}${getModifiers(columnName, column)}`;
colQueries.push(colQuery);
}
@@ -59,7 +59,7 @@ export function getCreateIndexQueries(tableName: string, table: Pick<DBTable, 'i
const unique = indexProps.unique ? 'UNIQUE ' : '';
const indexQuery = `CREATE ${unique}INDEX ${sqlite.escapeName(
- indexName
+ indexName,
)} ON ${sqlite.escapeName(tableName)} (${onCols.join(', ')})`;
queries.push(indexQuery);
}
@@ -194,8 +194,8 @@ function getDefaultValueSql(columnName: string, column: DBColumnWithDefault): st
// eslint-disable-next-line no-console
console.log(
`Invalid default value for column ${bold(
- columnName
- )}. Defaults must be valid JSON when using the \`json()\` type.`
+ columnName,
+ )}. Defaults must be valid JSON when using the \`json()\` type.`,
);
process.exit(0);
}