K
Kysely

help

Using column aliases in .where()

Oohmi5/25/2023
This is a supported feature in MySQL, but having issues here:
https://kyse.link/?p=s&i=xxyMrfnfJ6CjbRlQZpMA

Do I need to do something special for it to recognize the alias?
Solution:
Hey ๐Ÿ‘‹

Are you sure this is supported in MySQL?
https://dev.mysql.com/doc/refman/8.0/en/problems-with-alias.html
Jump to solution
Solution
IIgal5/25/2023
Hey ๐Ÿ‘‹

Are you sure this is supported in MySQL?
https://dev.mysql.com/doc/refman/8.0/en/problems-with-alias.html
Oohmi5/25/2023
i may have seen the You can use the alias in GROUP BY, ORDER BY, or HAVING clauses to refer to the column part of that page and jumped the gun
woops, sorry
IIgal5/25/2023
no worries

Looking for more? Join the community!

Recommended Posts
Using Postgres function in an insert with a field as a selectI'm trying to translate the following SQL: ```sql INSERT INTO sb.text_document_chunk (text_documentcreate role in migrationIs it possible to create a role in a migration? And to do the grants and things as part of that?How to insert JSONB types in postgres?I've looked at https://kysely-org.github.io/kysely/classes/InsertQueryBuilder.html#values and it's nQuerying two different tables with subset of common columnsI have two tables that have an intersection of common columns that I'm looking to query. For each ofHow to select from a function with parameters?I understand that `kysely` will not natively support stored procedures / functions, and was wonderinIn a transaction, how do you ignore generated field requirements?``` export interface TextDocumentTable { id: Generated<number>; created_at: Generated<Date>; } Cross database joins in MySQLHi all, Is it possible to do joins across databases within the same MySQL instance? i.e ```sql SELEC.where('x', 'is not', null) and correspond type's nullabilityNot sure if this even possible in typescript (although all of the work Kysely already makes it seem What is the suggested way of adding/removing methods to expression builders?Context: I am building a custom dialect for YDB https://github.com/Gaspero/kysely-ydb YDB is slightlRunning database agnostic queries (MySQL)As part of my test suite, I drop/create databases programmatically. Is it possible to have a Kysely Asserting type of .countAll() (MySQL)I've noticed that the return type from the result of aggregation functions like `countAll()` and `suCoalesce return empty arrayHey is there a way to return an empty array rather than `null` when an array column is empty? I alrkysely-codegen for multiple databasesI have two MySQL 'databases' within the same instance. From the documentation, it doesn't look like Using MySQL functions in SELECT statementHi! Just trying to migrate over from Knex. Skimmed over the documentation but still unsure of how t