Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More DB connectors #11

Open
davidjeba opened this issue Feb 13, 2023 · 3 comments
Open

More DB connectors #11

davidjeba opened this issue Feb 13, 2023 · 3 comments

Comments

@davidjeba
Copy link

Can you consider

  • CockroachDB
  • SurrealDB
  • Mongo Realm
  • etc?
@SalimF
Copy link

SalimF commented Feb 23, 2023

Hello, I didn't want to create new issue, but I ask how to install this plugin in server that suppose to not have MySQL or functional WP website?
when I tried to activate it i got this message :-
The SQLite plugin cannot be activated because a different wp-content/db.php drop-in already exists.
I'm sing the older wp-sqlite-db plugin which required copy the file db.php into wp-content/db.php but that not
With this plugin I found it path is /wp-content/plugins/sqlite-database-integration-2.0.0/wp-includes/sqlite/db.php should I copy it again t0 wp-content folder?

@adamziel
Copy link
Collaborator

adamziel commented Mar 27, 2023

Can you consider CockroachDB, SurrealDB, Mongo Realm

@davidjeba This is a really potent idea! The first step would be identifying all the MySQL-specific constructs in WordPress core. Here's a few examples:

I'm sure there's more than that – these just come from the chat I had with @OllieJones and @aristath last week about this specific subject.

Once the MySQL-specific parts are clear, there are a few ways to proceed:

  • Parse them so they can be translated into a different SQL dialect or even a NoSQL query. This may be needed to support all the MySQL-dependent plugins.
  • Abstract them out (no SQL, just an abstract method somewhere). This might be necessary in core to avoid the overhead of translating MySQL queries on each request.
  • Rewrite them in a more generic way (SQL subset). This could be an alternative to the above.

Furthermore, @OllieJones had an idea to support dedicated table schemas for different database engines – e.g. PostgreSQL could use FULLTEXT indexes out of the box.

I ask how to install this plugin in server that suppose to not have MySQL or functional WP website?

@SalimF I encourage you to start a new issue. Let's keep this one focused on supporting additional DB backends.

@adamziel
Copy link
Collaborator

adamziel commented Mar 27, 2023

Something else that came up during the chat I mentioned above:

Another thing to contemplate: Some applications out there in the world implement a lot of so-called "business logic" directly in SQL (with a code base containing hairy JOIN statements &c) Others use an abstraction layer -- an ORM -- to implement the business logic. WordPress's abstraction layer is WP_Query and friends, and the SQL layer is $wpdb.

A lot of code violates the layering, using WP_Query and $wpdb.

It's not easy to change a deployed app to move its SQL-layer business logic to an ORM layer. So I think it might be good to approach the problem from a SQL-centric point of view, rather than an enforce-ORM point of view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants