Comments (4)
The SQL statements that Base generates are quite simple. I wonder if, apart from the INSERT discussed in #3, there are other statements that might be incompatible with the other engines that PDO supports.
from base.
PDO does support a big list of engines. Each with their own differences - subtle or not.
Some differences from the top of my head:
- MSSQL does not have
LIMIT
orOFFSET
, instead it usesTOP
and subqueries. - Some differences in
ORDER BY
. - I don't even want to start with the Oracle implementation.
- And of course PostgreSQL uses double quotes to quote identifiers. It supports only single quotes for quoting strings. MySQL on the other hand uses backticks to quote identifiers and support both single and double quotes for strings.
Some resources:
- http://troels.arvin.dk/db/rdbms/
- https://wiki.postgresql.org/wiki/Things_to_find_out_about_when_moving_from_MySQL_to_PostgreSQL
from base.
Thanks! Then, perhaps, we should see which engines are compatible (or could become compatible after minor changes) with the current implementation and list them in the readme. SQLite might be one of them. We should also think about running the test suites on these engine.
p.s. Idiorm states that it supports SQLite, MySQL, Firebird and PostgreSQL and it has no drivers. Perhaps base should be able to support these as well.
from base.
Idiorm has things such as:
- Using different quoting for different engines - https://github.com/j4mie/idiorm/blob/1db83c9fee8a6418d92fd6fa87447d31faf88842/idiorm.php#L324-L344
- Using either
LIMIT
orTOP
- https://github.com/j4mie/idiorm/blob/1db83c9fee8a6418d92fd6fa87447d31faf88842/idiorm.php#L346-L361
Also it has options for these: https://github.com/j4mie/idiorm/blob/1db83c9fee8a6418d92fd6fa87447d31faf88842/idiorm.php#L70-L71
Another approach is having a syntax agnostic codebase for the query builder which does not build SQL strings, but just composes the syntax in objects/arrays and then adapters for the different SQL implementations carry out the syntax building. Examples:
- Doctrine DBAL drivers https://github.com/doctrine/dbal/tree/master/lib/Doctrine/DBAL/Driver
- Phinx adapters https://github.com/robmorgan/phinx/tree/0.4.x-dev/src/Phinx/Db/Adapter
- Kohana database drivers https://github.com/kohana/database/tree/3.3/master/classes/Kohana/Database
from base.
Related Issues (8)
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 base.