Hey, there a way to update an existing migration/table?
alterTable
alterTable
await db.schema.alterTable('users').addColumn('...')
await db.schema.alterTable('users').addColumn('...')
Does kysely convert Table names lowercase when it's building a query ?
Type of query result is {}[]
kysely-codegen
:...query
to itself was causing the issue. If I do something like this, the end result has the correct typing:
```
let queryBuilder;
...Unable to compile project with the TypeScript compiler (tsc) v.5.1.6
tsc
compiler which I rarely use (but still need sometimes nevertheless) is unable to compile because of some OnConflictBuilder
error, which is way too cryptic for me to understand.
I made a bare-minimum reproducible demo here:...How to reference the parent query when creating a subquery itself?
Can't get filterWhere to work with joins from another table.
filterWhere
with filterWhereRef
and now it's working correctly.is this uuid() correct in mysql?
aliases vs strict mode in tsconfig
DB
as a whole and when trying to figure out if an alias was used we compare against ${T} as {string}
.Kysely origin
coalesce in where statement
Which approach is better for coalesce and similar functions?
Single source of truth (defaultAlias-schema-tableName)
What's the pattern for writing migrations exactly?
kysely
's GitHub repo example, the migration files have dates, but those files aren't generated, so where did the dates come from ?
Well, let's say I don't want the migration files to have dates then I just create separate files for migrations and name them whatever? Ok, then how do I run them? Do I run them everytime the program starts ? Just help me out here, the docs doesn't mention anything about migrations I think it just assumes you are familiar with them already.....writing a transaction that calls functions
how to search inside a json type column, I'm using postgresql
How to inject parentheses in the generated arithmetic expression?
.withSchema() and raw SQL
sql <ReturnType> SELECT some_function(param);.execute(db)
the function is not found because it doesn't exist in the public
schema, although db
was created with .withSchema('myschema')
.
If I change the call to SELECT myschema.some_function(param);.execute(db)
it still doesn't work, because the function references tables in myschema
...JSON in columns (postgresql)
language
column and want to set a default value for the locale
key...Escaped paramaters in raw sql
``ts
export async function getRandomAnswerByQuestionId({ questionId, answerLimit }: { questionId: string, answerLimit: number }) {
return sql
SELECT * FROM get_random_answers(${sql.val(questionId)}, ${sql.val(answerLimit)})`.execute(databaseClient);
}...sql.val
in this case
https://kyse.link/?p=s&i=MEBVYcJHvb7Uj4c6chaI...Should database tables mimic form fields?