Dynamic return type based on provided select array
How to work with json columns?
Does the TypeScript performance scale with larger projects?
SQLite__namespace is not a constructor
import SQLite from 'better-sqlite3'
import SQLite from 'better-sqlite3'
Raw SQL in where clause
0.27.0
.
```....where('disabled_at', '>', sql<Date>`now()`)
.where('disabled_at', '>', sql<Date>`now()`)
smallint support (Postgres)
addColumn<CN extends string>(columnName: CN, dataType: DataTypeExpression, build?: ColumnBuilderCallback): CreateTableBuilder<TB, C | CN>;
addColumn<CN extends string>(columnName: CN, dataType: DataTypeExpression, build?: ColumnBuilderCallback): CreateTableBuilder<TB, C | CN>;
addColumn("foo", sql`smallint`)
addColumn("foo", sql`smallint`)
Examples inner join using OR?
ON a.id = b.id OR a.sub_id = b.sub_id
full join "using" list of columns
using
, what is the correct way ?
example:
```...Is kysely sanitizing sql injection when using raw sql ?
${myString}
where myString contains sql injection, will kysely sanitize it or is it something that I need to take care of ?...Support for D1 batching
Omit/filter out columns from query
select(['1','2','3','4','5','6','7','8','10']
select(['1','2','3','4','5','6','7','8','10']
How to create a typed array of columns for select?
jsonObjectFrom
helpers since they are valid Select optionsReturn `null` by default if no record found
null
instead of undefined
if no records match my query when using executeTakeFirst
. Is there a way to set this in the Kysely client?cmpr as eb call SqlBool return type
eb.cmpr
has been removed and I now need to use eb()
as a function. Is there an easy way to get back a boolean
instead of a SqlBool
?
Before I just needed to call it like eb.cmpr<boolean>
. Thanks!
(I mean, other than a plain type assertion)...eb(...).$castTo<boolean>()
Argument of type 'RawBuilder<unknown>' is not assignable to...
sql<string>`(SELECT activityId FROM activities WHERE MATCH(EL_EQ_PRODUCT_DESCRIPTION) AGAINST (${'+' + value} IN BOOLEAN MODE))`
sql<string>`(SELECT activityId FROM activities WHERE MATCH(EL_EQ_PRODUCT_DESCRIPTION) AGAINST (${'+' + value} IN BOOLEAN MODE))`
Generic function to stream a table
Schema
, T
etc. are really wide (in this case completely unbounded). There's no information for Kysely to work with. The types don't work unless you give it an actual bounded schema.
You should avoid generic functions like this when using Kysely. Super strict and generic just don't work well together....Type errors after 0.27.1 upgrade
"Correct" way to create a unique index with some raw SQL
username
column, but I want it to be unique on LOWER(username)
. I have the following, and it works, but I was wondering if there is an alternative way to do this without having it all as a raw query?
``
await sql
CREATE UNIQUE INDEX users_unique_username_idx ON users (LOWER(username));`.execute(
db,...TS2345: Argument of type "id" is not assignable to parameter of type ReferenceExpression<Database
Join + Nested Object
lodges
and lodge_conditions
. I just wanna make a query such that I'll get back something of the type
```typescript
Selectable<LodgesTable> & { conditions: Selectable<LodgeConditionsTable> }...conditions_id
and JSON object as columns and join with it on conditions_id
and select just the JSON object column....