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:...How to loop an array and based on this create a dynamic CTE but preserve type ?
``ts
for (const [references, columns] of referencesArray) {
const newQb = qb.with(
cte_${references}`, (wb) => {
wb = wb.selectFrom(references).distinct().selectAll(references);
for (const column of columns) {...string
into a string literal.
- Even if your strings had string literal types, you couldn't loop over them...On Conflict do update set ALL to be inserted columns
excluded
for those?
Example here...How to use kysely in edge runtime (like NextJS 14 middleware)?
how to write not (array1 && array2)
Partial compile
Querying on jsonArrayFrom
Why does `.stream()` return a single result when I pass in a `chunkSize` option ?
chunkSize
mount of rows for each iteration, but shouldn't it be an array instead?Is there a way to keep full date precision?
How can I get total row count without blowing up types?
.select(['some_id', (eb) => eb.fn.count('some_id').over().as('total')])
.select(['some_id', (eb) => eb.fn.count('some_id').over().as('total')])
Is there a way to handle migrations with .sql files?
Postgres: Transaction not honouring previous queries
error: duplicate key value violates unique constraint "xxxxx_key"
I only want the deletion to happen if the insertion is successful, and that's why I tried using transaction. However, the transaction seems to work in a different way than I thought.
...How do I specify a MySQL index hint?
USE INDEX ...
):
```sql
SELECT
sc.synopsis_fk,
'characters',...question about transaction isolation level
``
try {
await sql
BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;`...case when column = another column
.when("shahz_response", "=", "rank")
is where I'm attempting this, but this isn't working....when("shahz_response", "=", e.ref("rank"))
...