-
Notifications
You must be signed in to change notification settings - Fork 34
Feature/#133 add public from row #164
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
Feature/#133 add public from row #164
Conversation
This now allows people to interact with the database without having to bypass norm for more complex SQL.
|
@moigagoo before I do the (not that inconsiderable amount of) work of getting this PR into a "finished" state, I would like your confirmation first that the feature is actually wanted. |
Renamed "isContainer" to "isRefObject" Added documentation to utility procs
…le one was asked for
Due to the tables in postgres being created in a case-sensitive manner they require quotation marks around them and must be case-sensitive correct. This is only the case with postgres, not sqlite. https://stackoverflow.com/questions/43111996/why-postgresql-does-not-like-uppercase-table-names
|
Since the actual conversion of To me the work on this PR is thus done and it could be merged. |
|
@moigagoo Is this to be on ice until the escape column name PR is merged or is something else going on? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's just one comment I have. Otherwise, I'm ready to merge.
|
@PhilippMDoerner sorry for the slow responses. I've looked through the OR and found just one place where I have concerns. Please review this comment and we'll merge the PR. |
|
@moigagoo |
|
I'll release 2.5.2 Monday. I'm afk for the entire weekend. |
This proc adds the feature requested by #133 :
A way to interact with the database with arbitrary SQL, yet still benefit from norms incredibly useful parsing of Row to objects, just this time it allows for arbitrary object types instead of using models.
This has the following benefits:
idcolumn, as the user can define their own types for interacting with the viewThe specific procs that allows this are:
fromRowPosandfromRowwhich now can deal with any ref object as opposed to onlyModeltypesrawSelectprocs that make use of that and allow the user to pass non-Model ref object and a full SQL query to executeA small side-benefit:
I observed around a 10% speed-up for my limited test-cases when executing the "new" version of
fromRowPos. The reason for this speed-up is that some computation has been moved to compile-time instead of runtime.Things that would still need to be done:
Figure out in which module procs such as(I've decided to put them into a sharedisContainer,toOptionalandisEmptyColumnshould be stored, asrowutilsdoes not feel like the appropriate place for theseutils.nimmodule in private)Figure out actually decent names for(I've decided to go withisContainerandtoOptional. These names are (in my mind) only placeholders since I couldn't think of a better name for now. They are more "open" alternatives toisModelandmodel. With the new context of using ref object instead of Model howeverisRefObjectandrefObjectas names seemed confusing to me.toOptionalandisRefObject)Write tests for the(Basic tests are written. The details of the parsing into ref object do not need to be tested - the parsing from object to model already does that)rawSelectprocs (and maybe the modifiedfromRowPosproc) ( @moigagoo I would proceed with this point and the ones below once we ironed out the other ones)Add changelog changes(DONE)