Code Monkey home page Code Monkey logo

yii2-pgsql's People

Contributors

tigrov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-pgsql's Issues

Обновление Yii2 2.0.14

Обновление сломало работу расширения с ошибкой:
Declaration of tigrov\\pgsql\\QueryBuilder::batchInsert($table, $columns, $rows) should be compatible with yii\\db\\pgsql\\QueryBuilder::batchInsert($table, $columns, $rows, &$params = Array)

Bug when using together with yii2-queue

Hi.

When using your extension together with yii2-queue - it breaks because it uses bit field in an old manner (asumes PHP type to be an integer). I very much need your extension for Array and JSON fields, but other type conversions often make mess with other extensions and standard framework functionality. Could you, please, make a separate Shema class which would only handle Array and JSON types, and leave other's behavior untouched?

Error when try to parse DateTime expression

DateTime::__construct(): Failed to parse time string (to_date('01.01.9999') at position 0 (t): The timezone could not be found in the database

/var/www/api.is74.ru/vendor/tigrov/yii2-pgsql/src/ColumnSchema.php in __construct at line 135
...
return json_decode($value, true);
case Schema::TYPE_TIMESTAMP:
case Schema::TYPE_TIME:
case Schema::TYPE_DATE:
case Schema::TYPE_DATETIME:

/* Тут стоит перехватывать исключения, потому что выражения бывают несколько сложнее, чем просто текущее время.
Бывает дата прописана, бывает прописывается текущее время со сдвигом вперед.
В случае если не удалось разобрать строку, то вернуть NULL.

I think here need to add try-catch. Parser can't parse some expressions and we have an exception. But we can catch exception and set NULL value for column in this case. Now we need change default value in database although this is valid expression for database.
*/
return new \DateTime($value);
case Schema::TYPE_COMPOSITE:
return $this->phpTypecastComposite($value);
}
return $this->typecast($value);

DateTime в формах

Каким образом можно использовать обьект DateTime в формах?

<?= $form->field($model, 'from_date')->widget(\yii\jui\DatePicker::classname(), [ 'dateFormat' => 'yyyy-MM-dd', ]) ?>
Ошибка
Object of class DateTime could not be converted to string

Composite Type in materialized view

Если создать материализованную вьюху(да и наверно просто вьюху) на основе таблицы с массивом композитного поля(some_type[]) - то при формировании модели это поле получается в виде строки.

save composite type from model

Not work save to db from model, that was created from this type on select from db.

$newModel = Product::findOne($model->id);
$newModel->price; // is new Money(['value' => 10, 'currency_code' => 'USD'])
$newModel->price->value = 20;
$model->save(); - not work. In db still value = 10.

But your exemple with new model works fine:

$newModel = Product::findOne($model->id);
$model->price = new Money([
'value' => 10,
'currency_code' => 'USD'
]);
$model->save();

Why there is no support for PHP 5.5?

This is a very useful library. But the PHP version restrictions do not allow me to use in my application. Can you reduce the requirements in the composter?

Failed to parse time string

Hello.
Your package is awesome!
But I found bug when try to execute migration

Exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (NULL::timestamp without time zone) at position 0 (N): The timezone could not be found in the database'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.