aDevWhosTrying
aDevWhosTrying
Explore posts from servers
KKysely
Created by aDevWhosTrying on 9/9/2023 in #help
Stumped - sqlite kysely no data from select query
Hey just wanted to say thanks for the response. I'm dropping kysely for this project and refactoring to use raw sql statments... kysely is a great tool and I look forward using it is prod. Maybe when I refactor the Electron App to use Electron Forage that can support better-sqlite3... oof development, am I right. Cheers
8 replies
KKysely
Created by aDevWhosTrying on 9/9/2023 in #help
Stumped - sqlite kysely no data from select query
I saw the preference in getting started, but hoped that was a "best practice". The electron boilerplate I am using doesn't support better-sqlite3. Can I create my own dialect for node-sqlite3 not sure if this is a possibility.
8 replies
KKysely
Created by aDevWhosTrying on 8/31/2023 in #help
How to access error events -- Is there a best/good practice for error handling
Thank you for the response. This doesn't seem to work. I attempted to create the same table twice and it logs and error but does not throw and error or return and error object for work with. To me, this implies that I will have to write checks or come up with some other error handling pattern.
let newTable = db.schema
.createTable(tableName);


columns.forEach((c) => {
console.log(c);
newTable = newTable.addColumn(c.name, c.type, (col) => {
if (c.isUnique) {
return col.notNull().unique();
}
return col;
});
});
console.log(newTable);
await newTable.execute().catch((err) => {
cliLogger.error('ERROR - creating new table');
console.log(err);
});
let newTable = db.schema
.createTable(tableName);


columns.forEach((c) => {
console.log(c);
newTable = newTable.addColumn(c.name, c.type, (col) => {
if (c.isUnique) {
return col.notNull().unique();
}
return col;
});
});
console.log(newTable);
await newTable.execute().catch((err) => {
cliLogger.error('ERROR - creating new table');
console.log(err);
});
What are other people/teams doing for tests and error handling coverage?
3 replies
KKysely
Created by aDevWhosTrying on 8/30/2023 in #help
`createTable` function with dynamic column array
Is that an npm package? New frontend framework? kek kek thank for the sage advice.
7 replies
KKysely
Created by aDevWhosTrying on 8/30/2023 in #help
`createTable` function with dynamic column array
Thank you for the response, I’ll confirm in a bit. Any tips on being more aware in the future?
7 replies