Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Columns name with underscore #11

Open
siberiadev opened this issue Feb 28, 2020 · 2 comments
Open

Columns name with underscore #11

siberiadev opened this issue Feb 28, 2020 · 2 comments

Comments

@siberiadev
Copy link

siberiadev commented Feb 28, 2020

Hey there! Thanks for awesome lib.
I got stuck with project where all DB column names have underscores.
for exp:

value_type
created_at

So, when I use knexnest it make me fill very bad.
Check below:

knex.select([
    'u.value_type as _value_type'
])....

This query return me an object like:

{
    value: {
        type: 'someType'
    }
}

but I need

{
    value_type: 'someType'
}

How can I fix it? Any recommendation? Thanks a lot.

@imduchy
Copy link

imduchy commented Jun 4, 2020

Would it work to do something like

knex.select([
    'u.value_type as _valueType'
])....

or do you specifically need value_type?

@johnykifle
Copy link

johnykifle commented Mar 19, 2021

Any update on this one? @Duchynko that would require changing all the db schema to camel case format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants