@tmlmobilidade/go-clients-sqlite 20261027.2048.32 → 20261028.1757.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/sqlite-db.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/sqlite-db.js
CHANGED
|
@@ -87,7 +87,7 @@ export class SQLiteTableInstance {
|
|
|
87
87
|
this.tableName = tableName;
|
|
88
88
|
// Create table
|
|
89
89
|
this.databaseInstance
|
|
90
|
-
.prepare(`CREATE TABLE IF NOT EXISTS ${this.tableName} (${params.columns.map(c => `"${c.name}" ${c.type}`).join(', ')})`)
|
|
90
|
+
.prepare(`CREATE TABLE IF NOT EXISTS ${this.tableName} (${params.columns.map(c => `"${c.name.replaceAll('"', '""')}" ${c.type}`).join(', ')})`)
|
|
91
91
|
.run();
|
|
92
92
|
// Create indexes
|
|
93
93
|
params.columns.forEach((c) => {
|
|
@@ -98,7 +98,7 @@ export class SQLiteTableInstance {
|
|
|
98
98
|
//
|
|
99
99
|
// Prepare insert statement
|
|
100
100
|
const placeholders = this.columns.map(() => '?').join(', ');
|
|
101
|
-
const insertSQL = `INSERT INTO ${this.tableName} (${this.columns.map(c => `"${c.name}"`).join(', ')}) VALUES (${placeholders})`;
|
|
101
|
+
const insertSQL = `INSERT INTO ${this.tableName} (${this.columns.map(c => `"${c.name.replaceAll('"', '""')}"`).join(', ')}) VALUES (${placeholders})`;
|
|
102
102
|
this.insertStatement = this.databaseInstance.prepare(insertSQL);
|
|
103
103
|
}
|
|
104
104
|
/**
|