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

Pgsql encoder #21

Open
wants to merge 28 commits into
base: pgsql-encoder
Choose a base branch
from
Open

Conversation

gvasilopulos
Copy link

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

nexus added 18 commits January 27, 2017 23:16
…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
@tom--
Copy link
Owner

tom-- commented Feb 11, 2017

please use yii2-conding standards and yii2 code style.

my ide reformats code to conform so this is not hard work.

@tom--
Copy link
Owner

tom-- commented Feb 11, 2017

please fix your local git config so the commits are attributed to you rather than "nexus"

@@ -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;
Copy link
Owner

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.

Copy link
Author

@gvasilopulos gvasilopulos Feb 11, 2017

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.

@ilgiz-badamshin
Copy link

Is PR will be merged? And which branch is actual?

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

Successfully merging this pull request may close these issues.

3 participants