Comments (3)
Just read your comment to issue 3. That looks like it would work to fix the additional types like Macaddr etc. Just define them one level up and add a comment. A little extra work making sure the comments are where they need to be. The assumption about id being a number looks a little harder to work around.
from kanel.
Ah yes, this is a symptom of the fact that I just extracted the code from a larger project, so these are cases that aren't covered yet. I think maybe type-comments would help but for this case, it seems more like you should be able to specify type mappings in the configuration file. I will look into that today.
ID's being hardcoded as numbers is a clear bug, they should extract the type of the column obviously. And yes, that might be slightly more difficult to fix but I will dig into that as well :-)
from kanel.
I've just published a new version that fixes the id-type bug.
As for custom type mappings, it turns out that I had already implemented it, just not documented it yet. You can specify custom types in the customTypeMap
config property. Note that it doesn't add import statements yet, so it will only work with primitives. It should probably be expanded.
from kanel.
Related Issues (20)
- Support Knex enums (CHECK constraints) HOT 4
- kanel-kysely should include schema in Schema.ts output HOT 6
- Missing support for INHERITS HOT 1
- IDE error on import {type default as ....}? HOT 6
- code: 'ERR_REQUIRE_ESM' HOT 3
- Using camel case with kanel-kysely HOT 3
- Inconsistency with introspecting compositeTypes HOT 1
- text[] issue on V2 HOT 7
- Feature / pull request: API-based indexes HOT 1
- Support generating types for foreign tables HOT 6
- kanel-zod doesn't play nice with kanel-kesely HOT 8
- Generating iterable union types with kanel-kysely HOT 4
- bytea example relies on `bytea` package which does not exist HOT 2
- Specify pg_catalog.* in the docs for customTypeMap HOT 6
- Issue with Identifier Types and Composite Foreign Keys (kanel + kysely) HOT 3
- Implement table ignore feature HOT 1
- Make identifier aliasing optional HOT 1
- kanel-kysely should provide config options for `namespace` or `multi-tenant` style for multi-schema usage. HOT 3
- kanel schema aware Identifiers HOT 1
- kanel import name conflict when different schemas contain tables with the same name HOT 1
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 kanel.