Comments (6)
I don't think that expression should be an interface as is. Expression represents Dibi specific syntax. If so, an interface should say that object can be converted into Dibi Expression e.g. via method function toDibiExpression(): Expression
.
from dibi.
I don't see how that is different. Your object would have to return an instance of "dibi specific syntax" anyway and it would achieve the same. But I would be comfortable with that too, anything is better than inheriting from internal objects, that tend to become final, private and such...
from dibi.
Why do you specifically need it?
from dibi.
I'm writing a convertor that converts key-value arrays to conditions, agnostic of the storage backend.
For SQL, I'm trying to use Dibi. One of the objects I internally use is a "self-unpackable" condition used on both Fluent
like this $expression($fluent)
as a decorator, and in "regular sql" with %ex
modifier.
With Dibi as it is, I need to either extend Expression
or use a workaround to support both, neither being an elegant solution.
from dibi.
And why can't the converter create a Dibi\Expression object?
from dibi.
At the time of writing, I had a syntax tree composed of backend-agnostic nodes. I intended for these nodes to be instances of Expression
, but I since scraped the idea and now use a tree traversal algo to converted the structure to a structure of nested Expression
s. The downside of this is one more traversal.
This issue was meant to future-proof extensibility options with similar use cases, but I'm fine with the current state for now.
from dibi.
Related Issues (20)
- `MySqliDriver::getResource` throws in PHP 8 instead of returning `null` whe the resource has been closed prior to the call HOT 1
- MySqliDriver: Do not close connection when initialized with a resource (side effect)
- Panel error when using two connections HOT 3
- Possible support for staabm/phpstan-dba
- Surplus 'N' in front of string param HOT 6
- Split query result by table
- Automatic object to Expression conversion HOT 3
- Alone quote in SQL comment causes SQL translate error HOT 2
- Dibi event performs too many filesystem stat calls HOT 2
- getRowCount with SQLSRV driver HOT 1
- Calling multiple stored procedures subsequently - Commands out of sync; you can't run this command now
- Bug in Dibi\Datetime modify HOT 2
- result->free, mysqli_result object is already closed HOT 1
- Unable to extend `Result` object
- Unable to set the `flags` config via environment variable HOT 2
- Customize profiler log? HOT 3
- SqlsrvDriver: column types are not detected HOT 1
- TypeError: Dibi\Bridges\Tracy\Panel::getConnectionName(): Argument #1 ($connection) must be of type Dibi\Connection, null given
- SQLite3::enableExceptions(false) is deprecated in PHP 8.3 and later HOT 1
- Problem with #[Language('GenericSQL')] attribute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dibi.