-
Notifications
You must be signed in to change notification settings - Fork 15
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
Pgsql encoder #21
base: pgsql-encoder
Are you sure you want to change the base?
Pgsql encoder #21
Conversation
…ncodeDynamicColumn seems to work in pg
…ial column added test results for review by tom--
…created DynamicActiverecordPgJsonTest by clonning the DynamicActiverecordTest to be able to tweek it the way postgres expects data to be queried added new test results pgencoder.xml
…IMHOaltered fixtures to enter the correct for json boolean input
…IMHOaltered fixtures to enter the correct for json boolean input
…en char is used (though it proves unnecessary, values stil return double quoted from pg), reverted changes to fixtures for bool_values
…en char is used (though it proves unnecessary, values stil return double quoted from pg), reverted changes to fixtures for bool_values
…type casting with | in columnexpression
…type casting with | in columnexpression
please use yii2-conding standards and yii2 code style. my ide reformats code to conform so this is not hard work. |
please fix your local git config so the commits are attributed to you rather than "nexus" |
DynamicActiveQuery.php
Outdated
@@ -216,7 +216,7 @@ public function createCommand($db = null) | |||
% (`?) \(! \s*? | |||
( [a-z_\x7f-\xff][a-z0-9_\x7f-\xff]* (?: \. [^.|\s]+)* ) | |||
(?: \| (binary (?:\(\d+\))? | char (?:\(\d+\))? | time (?:\(\d+\))? | datetime (?:\(\d+\))? | date | |||
| decimal (?:\(\d\d?(?:,\d\d?)?\))? | double (?:\(\d\d?,\d\d?\))? | |||
| decimal (?:\(\d\d?(?:,\d\d?)?\))? | double (?:\(\d\d?,\d\d?\))? | numeric? | text ? | | |||
| int(eger)? | (?:un)? signed (?:\s+int(eger)?)?) )? | |||
\s*? !\) \1 %ix | |||
REGEXP; |
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.
if you want to use the same regex for pgsql and maria then we must test that all acceptable patterns behave properly. e.g. do things like decimal
, datetime
and double
work in pgsql? do numeric
and text
work in maria?
if not then the exception should make clear what the problem is.
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.
I was thinking to implement just 3 types for pg numeric, jsonb, and char/text which is the default.
Postgres may have a hole lot of other types but in my mind that does not matter since we get json types back.
If anyone wants to typecast to anything else he can use (!dyncol|jsonb!)::postgres_data_type.
I'm thinking of including that possibility to the documentation. In fact the type declaration with the format dyncol|type was done for compatibility reasons one could use ::type straightforward in the start of the implementation.
You are right about removing it from maria's regexp. I will remove it asap and implement a regexp for pg.
I used a psr2 formatter to format the code to psr2 which I think is the yii2 coding standard.Hope it is ok now
I also added my real name and email to the git configuration
I'll get back to you with bug report later today.
… use char as default type and numeric and json if explicitly declared
…ordtest updated tests results
4ff2f11
to
e4003a9
Compare
Is PR will be merged? And which branch is actual? |
This is the work so far
There are 2 tests failing and 1 in error see pgencoder7.xml
I'll create a bug report tomorrow to let you know of the progress and the failures/errors of the tests