Comments (8)
@xiaoyu-tamu I just added the first version of the plugin interface and a plugin called CamelCasePlugin
from kysely.
Yep. I'll add a plugin interface and implement a camelCase conversion as a plugin.
from kysely.
Yes.
from kysely.
that would be nice!
from kysely.
Hi, @koskimas
I just tried it and it works as expected
from kysely.
However, the conversion will be done for the SQL as well as the return value, as they are defined using the same interfaces. For example, if you have a table person_table
with columns id
and first_name
, the conversion would work like this:
interface Person {
id: string
firstName: string
}
interface Database {
personTable: Person
}
const db = new Kysely<Database>(...)
await db.selectFrom('personTable').select('id').where('firstName', '=', 'Sami')
So EVERYTHING needs to be converted to camelCase by the plugin, or else the type system won't work. Kysely won't allow the return value column names to be different from the ones used in the queries.
from kysely.
what's the generated sql for this query?
await db.selectFrom('personTable').select('id').where('firstName', '=', 'Sami')
will the above query generate as this sql?
select id from person_table where first_name = 'Sami'
from kysely.
will try it later today.
from kysely.
Related Issues (20)
- Allow beginTransaction and rollbackTransaction calls. HOT 1
- ColumnType is not extracted for array data type HOT 1
- Merge temp table as source table HOT 2
- mssql recursive CTE support HOT 1
- [FEATURE REQUEST]: Camel case plugin - option to disable transformations on selected columns or data types HOT 1
- [FEATURE REQUEST] enum tables HOT 1
- How to define a custom plugin using the FunctionNode? HOT 1
- Merging JSON objects HOT 1
- Tedious v18 includes different TypeScript annotations HOT 2
- what is the migration_lock ?? HOT 2
- Invalid object name upon inserting value into temp table in mssql HOT 3
- Type Error for BLOB columns when using D1 Databases HOT 1
- [Question] best way to create reusable type-aware filters HOT 2
- Calling Migrator.migrateToLast() exits process HOT 2
- Add an AlterTypeBuilder
- where with sql complains about Property 'isSelectQueryBuilder' is missing HOT 1
- Improvement of lateral support HOT 1
- Migrations can be modified without notice HOT 3
- Incorrect type when using left join and json agg (postgres) HOT 3
- Also publish to JSR?
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.