Comments (3)
You can create a helper function like this so that you don't need to explicitly give the output type: https://kyse.link/Rip3y
from kysely.
This seems to work https://kyse.link/we2xz
What's the issue?
from kysely.
Thanks, this helper is nice.
The specific issue was that wouldn't it make sense to have a c.fn.array
? Or maybe I'm misunderstanding the point of c.fn?
Also, for anyone who maybe is trying something like where I eventually was going (which is pretty unrelated to the issue but for issue search), I ended up doing
.leftJoinLateral(
(e) =>
sql<{ tags: string[] }>`(select array(${e
.selectFrom("entitytags")
.select("tag")
.whereRef(
"user_entity",
"=",
"userentities.id"
)}) as "tags")`.as<"tags">(sql`tags(tags)`),
(e) => e.onTrue()
)
like
builder = builder.where("tags", "&&", [tags]);
The reason for this is I wanted to be able to filter using where
on that column. Its a bit of a mess of typings and such but it works well enough
from kysely.
Related Issues (20)
- How to handle "empty" column selections? HOT 1
- The type of `eb` in `selectFrom(eb => ...)` is wrong
- RLS via Plugin? HOT 5
- getting started documentation errors with MssqlDialect
- db.schema returns undefined HOT 4
- fn.agg doesn't type-check HOT 6
- Typesafe select expression builder helper HOT 3
- MySQL `insertId` is undefined after executeTakeFirstOrThrow() HOT 3
- Enhance flexibility of `createPool()` in `MysqlDialectConfig`
- "Extending kysely" example doesn't compile HOT 3
- Unsupported MySQL DataTypes HOT 2
- Construct standalone SQL Snippets HOT 1
- [Discussion][Effect integration] Add Executable inheritence to all Executable Builders HOT 3
- Incorrect `selectAll` typing HOT 4
- Cant use raw table names with Insert/Update/Delete HOT 1
- Mssql connection pooling issue. Multiple server round trips per query. HOT 1
- Discord link expired HOT 1
- suggestion: add isPartitionTable property in TableMetadata interface
- <statement expected> got .... instead when using sql function
- Is Type incorrect in `UpdateQueryNode` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kysely.