-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make view.columns() functionality optional when creating a view #4827
Comments
Please do, views without columns are standard (it will be optional in the code like you write). |
@OlivierCavadenti when is this going to be released? |
@thefoxie Would RC release work for you? |
@kibertoad yeah sure :) |
I'll publish 1.0.0-next1 tonight then. |
Released in 1.0.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Knex version: 0.95.14
Database + version: PostgreSQL 13.4
OS: Windows10
Feature discussion / request
As a PostgreSQL user, I would like to be able to create such queries for views:
create view "users_view" as select "users".*, "user_roles"."role_code" from "users" inner join "user_roles" on "users"."user_id" = "user_roles"."user_id"
I could achieve it this with this code:
But currently this doesn't work because I didn't use
view.columns()
functionality, so knex throwscolumns is not iterable
error.I edited the
knex\lib\schema\viewcompiler.js file
, changed part ofcreateQuery
code like this and everything worked as I wanted:I would be happy to provide a PR if this is something you would like.
The text was updated successfully, but these errors were encountered: