Code Monkey home page Code Monkey logo

Comments (4)

erusev avatar erusev commented on August 16, 2024

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.

hkdobrev avatar hkdobrev commented on August 16, 2024

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 or OFFSET, instead it uses TOP 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:

from base.

erusev avatar erusev commented on August 16, 2024

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.

hkdobrev avatar hkdobrev commented on August 16, 2024

Idiorm has things such as:

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:

from base.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.