laminas / laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
https://docs.laminas.dev/laminas-db/
BSD 3-Clause "New" or "Revised" License
122 stars 69 forks source link

Add JSON support. #192

Closed tptrixtop closed 2 years ago

tptrixtop commented 3 years ago

Hello all,

I have designed some feature for working with JSON, this feature must simplify working with JSON, for now i have added support only for mysql, but if it needed i will implement it for postgress and will try do the same for other adapters)

The idea of that is to simplify updating of json document, to exclude working with json_set/json_merge/patch etc, we can just implement some mini-language something like this

$update = new Update; $update->table('foo') ->set( ['data->foo.is_checked' => true] ) ->where([ 'id = ?' => 1, ]) ;

so it will transform into this code UPDATEfooSETdata= JSON_SET(data, '$.foo.is_checked', '1') WHERE id = '1'.

Also added json_remove support

$update = new Update; $update->table('foo') ->set( ['data->foo.is_checked' => new JsonRemove()] ) ->where([ 'id = ?' => 1, ]) ;

dfelton commented 3 years ago

As much as I'd like to see this package continue to be maintained, my understanding is that it is in a security-only mode.

In the end, we voted to accept the results of the async vote held last month. As such, all of the components listed will go into security-only mode, and receive no new bugfixes unless we have maintainers step up with concrete plans for maintaining and evolving the component.

tptrixtop commented 3 years ago

yes but I thought it was reopened)

dfelton commented 3 years ago

yes but I thought it was reopened)

Interesting. If so, I'd like to re-open issue #1. Will wait to see what becomes of these recent issues and PRs though. Thanks!

tptrixtop commented 2 years ago

@Ocramius

Ocramius commented 2 years ago

Not a fan of this myself: easier to write the SQL expression as a string, than to add a castle of abstractions around a simple SQL function call :thinking:

As for the patch itself, laminas-db is closed for new features, unless it's about supporting new dependency versions, fixing critical bugs, or security issues.

In order for this component to progress, we first need a new maintainer.

Will close according to our current maintenance plans: that has nothing to do with the feature per-se, but rather with the rejection of new features overall, sorry.