fix(questdb): preserve credentials and correct startup table SQL
This commit is contained in:
parent
dd7ac53c51
commit
3a290cc8a7
5 changed files with 115 additions and 10 deletions
|
|
@ -311,16 +311,11 @@ export class QuestDBSchemaManager {
|
|||
* Build CREATE TABLE SQL statement
|
||||
*/
|
||||
private buildCreateTableSQL(schema: TableSchema): string {
|
||||
// QuestDB's column grammar has no PostgreSQL-style NOT NULL constraint.
|
||||
// nullable remains descriptive metadata; the designated timestamp is declared
|
||||
// below. See https://questdb.com/docs/query/sql/create-table/.
|
||||
const columns = schema.columns
|
||||
.map(col => {
|
||||
let columnDef = `${col.name} ${col.type}`;
|
||||
|
||||
if (!col.nullable) {
|
||||
columnDef += ' NOT NULL';
|
||||
}
|
||||
|
||||
return columnDef;
|
||||
})
|
||||
.map(col => `${col.name} ${col.type}`)
|
||||
.join(', ');
|
||||
|
||||
let sql = `CREATE TABLE IF NOT EXISTS ${schema.tableName} (${columns})`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue