cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
54 stars 24 forks source link

Adds ColumnReturnableInterface for database drivers, which support RETURNING clause #25

Closed butschster closed 2 years ago

butschster commented 2 years ago

At this moment we have Postgres driver and it supports RETURNING clause, but we don't have an ability to check it without expression like this $insert instanceof \Cycle\Database\Driver\Postgres\Query\PostgresInsertQuery

This PR adds a new interface Cycle\Database\Query\ColumnReturnableInterface and it provides an ability to check whether a driver supports RETURNING clause.

See https://postgrespro.com/docs/postgresql/9.5/dml-returning

codecov[bot] commented 2 years ago

Codecov Report

Merging #25 (7d3bf27) into master (bc3b434) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #25      +/-   ##
============================================
+ Coverage     92.17%   92.18%   +0.01%     
- Complexity     1535     1537       +2     
============================================
  Files            93       93              
  Lines          4052     4058       +6     
============================================
+ Hits           3735     3741       +6     
  Misses          317      317              
Impacted Files Coverage Δ
src/Driver/Postgres/Query/PostgresInsertQuery.php 94.44% <100.00%> (+1.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc3b434...7d3bf27. Read the comment docs.