I was wondering if there is a library that implements an SQL-like interface for accessing data in an array, for example.
Input:
[
['name' => 'Tom', 'age' => 27, 'location' => ['country' => 'GB']],
['name' => 'Jerry', 'age' => 16, 'location' => ['country' => 'LT']],
['name' => 'Stuart', 'age' => 26, 'location' => ['country' => 'GB']]
]
Fictional request:
SELECT name, location.country FROM {input} WHERE age > 18 ORDER BY age DESC
This will result in a change:
[
['name' => 'Tom', 'location.country' => 'GB'],
['name' => 'Tom', 'location.country' => 'GB']
]
Notice that I know very array_filterwell similar implementations that I could put together. I am looking for a query as an interface for accessing data.
Gajus source
share