How to add table/column comments when creating tables?
modifyEnd
where possible to add comments with sql
template tag....Need help improving a custom helper
ExpressionBuilder
callback thingy anywhere if it did. We could just use free functions and they'd somehow catch the context through generics in the return value.
another option is month(eb)('created_at')
....jsonArrayFrom with `as` not being typed
How to use multiple schema definitions ( e.g. <catalog>.<schema>.<table> )
Using raw SQL with `or` where
orWhere
clause using it. Here is a simple example of what I am trying to achieve.
```ts
const result = await db
.selectFrom('users')...eb.or
expects a list of Expression<SqlBool>
where SqlBool
is boolean | 0 | 1
Custom Plugin to transform Alias.* to "Alias.Column1", "Alias.Column2", etc.
can kysely be extended with custom types within the database
newbie need help with json_build_object
JSON_BUILD_OBJECT('id', unit.id, 'name', unit.name) AS unit
JSON_BUILD_OBJECT('id', unit.id, 'name', unit.name) AS unit
unit
object because you're using left join. The types are correct. If you are sure there's a unit
for each sku
then use innerJoin
instead....Solved: Exporting query builder classes
building kysely makes the package size very large
bun build --minify --outfile
, i get kysely to be 340.40kB whilst drizzle is 55.35kB, meanwhile the functional code besides the database is identicalKysely setup in monolith API
Is it possible to get the total count while fetching rows in a single query?
Separating results of join into objects of each type
Snippet compilation
Creating an 'enum' type column
Error when destructuring QueryCreator in withRecursive
Is `sql.join` the best way to concatenate sql templates?
let q = sql.raw` noteFtsFv.rowid ` + sql.raw` in `
let q = sql.raw` noteFtsFv.rowid ` + sql.raw` in `
Multiple calls to values in insert statement?
.values
multiple times on a query object. I've fixed it by passing an array to a single values call instead, but this seems like a bug no? Either the types should reflect that values can no longer be called after it has been, or it should collect the values calls into one array?using pgvector with Kysely
ERROR: column "embedding" is of type vector but expression is of type character varying
Happy to provide code if necessary but there arenβt any differences from the tutorial ...// Replace `string` with the type you have in the table interface.
sql<string>`${sql.ref(column)} <=> ${toSql(value)}::vector(3)`
// Replace `string` with the type you have in the table interface.
sql<string>`${sql.ref(column)} <=> ${toSql(value)}::vector(3)`
Static/reusable custom window functions
array_agg
window function and would like to reuse the existing FunctionModule
in a reusable way, so to have orderby, over, and so on.
Is there a way to get the function module you get from fn.agg
outside of an expression builder and without creating a puppet kysely instance, so to create an array_agg
function and return what fn.agg
return but properly typed?
As an example:...