Closed (fixed)
Project:
Drupal core
Version:
9.2.x-dev
Component:
database system
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jan 2020 at 20:14 UTC
Updated:
8 Feb 2021 at 10:34 UTC
Jump to comment: Most recent
Comments
Comment #2
effulgentsia commentedComment #3
effulgentsia commentedComment #4
andypostInteresting point about official PHP docker images, they based on debian:buster and alpine, so both should be fine for sqlite
Comment #5
daffie commentedThe question that I have is: How easy is it for Windows and Mac users to get SQLite on their systems with the json1 extension? (and also with the DSQLITE_MAX_VARIABLE_NUMBER setting being higher then/equal 250000?)
Does anybody have any idea how many people on Windows and Mac use SQLite as a database for Drupal to test it out?
Comment #6
daffie commentedComment #7
effulgentsia commentedSince D9 requires PHP 7.3, the first part is getting at least PHP 7.3. On Mac Mojave, the shipped PHP version is 7.1. One way to get PHP 7.3 or 7.4 is to install MAMP 5.6. Via that, both the PHP 7.3 and 7.4 builds include SQLite with the json1 extension. Another way to get PHP 7.3 or 7.4 is with Homebrew. Via that, both the PHP 7.3 and 7.4 builds also include SQLite with the json1 extension. On Mac Catalina, the shipped PHP version is 7.3, and it also includes SQLite with the json1 extension.
I don't know about Windows.
I don't know. I'll try to find out though.
Comment #8
daffie commentedI have asked the same question on #3107155-11: Raise SQLite version requirement to 3.26 in Drupal 9 and @andypost answered with
Comment #9
effulgentsia commentedLooks like it was SQLite 3.24 that started enabling json support by default. Note, that's only by default if you're using their autoconf script to configure the compilation. Now I'm more curious about Ubuntu 18.04, which ships with 3.22, but I thought had it with json support, which would imply they compiled it with non-default arguments. I'll see if I can confirm that.
Comment #10
effulgentsia commentedFound it: https://git.launchpad.net/ubuntu/+source/sqlite3/tree/debian/rules?h=ubu.... I think this means that 3.22+ on Ubuntu and 3.24+ elsewhere is likely to have json support.
Comment #11
mglamanI'd love to have JSON support in all database drivers, but I'd say a lot of my day to day involves Drupal on SQLite for local development and contrib development. It sounds like #7 shows it is (most likely) a non problem on macOS?
Comment #12
effulgentsia commentedAnd here's where it was added to PHP 7.3 prior to becoming unbundled (and therefore using however it was compiled on the system) in PHP 7.4.
So the summary is, SQLite json support is ON by default in all of:
Comment #13
gábor hojtsyComment #14
catchWe're already planning to increase requirements for MySQL, postgres and sqlite to version that support JSON, and the required versions for contrib drivers don't seem onerous.
The only question for me is whether it's worth officially requiring support in the database drivers before we have support for it in Drupal. i.e. we'd need to add JSON support to the database layer, and then we'd need an implementation in core. We only really need to require JSON once we have a non-optional core implementation. I guess there's an argument that it's better to add the requirement prior to a major version rather than during if we expect to have an implementation added prior to 10.x though.
Comment #15
effulgentsia commentedLet's see what feedback we get in #3113753: Can the SQL Server minimum be raised to 2016 for Drupal 9?.
Comment #16
andypostComment #17
effulgentsia commentedThe feedback in #3113753-2: Can the SQL Server minimum be raised to 2016 for Drupal 9? was +1.
I just now opened #3118766: Require 12.1 as the minimum Oracle version for the Drupal 9 version of this driver.
I think that makes this decision RTBC, but we still need to figure out how to best communicate it (probably a change record, maybe also a release note mention?, maybe a handbook page?) so that other contrib/custom db drivers out there know about this.
Comment #18
catchhttps://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/... is the requirements page, it could be a footnote there maybe?
Both a CR and release not seems sensible for this one.
Comment #19
alexpottA slightly sad thing is that postgres doesn't support generated columns until version 12 (only just released) and SQLite in 3.31.0 (only just released too). MySQL supports this since 5.7. This is important because it we want to have indexes on anything in the json this would make that possible. Considering configuration - that'd allow us to remove the awfulness of storing configuration lookup keys in state. Here's an article that explains what generated columns are and why they are important... https://www.percona.com/blog/2016/03/07/json-document-fast-lookup-with-m...
Comment #20
andypostBtw sqlite 3.31 adds uuid function, so follow up for uuid fields needs to be filed
Comment #21
effulgentsia commentedRe #19, PostgreSQL supports jsonb indexing (since 9.5) and SQLite supports expression indexing (since 3.9). Is that not enough for most json querying use cases, including config?
Comment #22
alexpott@effulgentsia that does look interesting - that'd be great for config. Shame MySQL doesn't offer an equivalent - apart from the generated columns thing. Will be fun to add sort for json indexes in an db agnostic way... the things you point to make it look easier for SQLite and Postgres.
Comment #23
catchWe should add #19 to whatever the 10.x database requirements issue is (I think there already is one, or at least a meta with a placeholder).
Comment #24
andypostLooks #21-22 are more about related
Comment #25
catchSo we still need a release note and change record here, but also this seems a bit late now we're already close to RC - we should really have documented it when the decision was made.
Comment #26
andypostAs it goes to 10.0 it can bet on php-sqlite will linked to system library
Comment #27
catchUpdating the issue summary. We should try to reach a decision here sooner than later so we can bump Drupal 10's database requirements as soon as it opens.
Comment #28
daffie commented+1
For >99% of the Drupal sites there will be a free performance increasement. I am not sure how much that increasement will be. For the <1% of the sites that run Microsoft SQL Server lower then version 16 or SQLite with PHP 7.3, they will not get support for Drupal 10. That will only be a handful of sites. Also AFAIK PHP 7.3 will not be supported on Drupal 10. For me this is an easy choose. I fully support having json support as a requirement for all databases in Drupal 10.
Comment #29
catchTried a bit of an issue summary update.
Comment #30
mradcliffeJust a quick note while I have some time and thinking about this.
We don't need any abstraction for simply storing JSON since it's text. However we will need an abstraction layer for querying or parsing JSON data structures in SQL. A mechanism for accessing nested properties in Condition or Select fields needs to be worked on. I don't think that should block requiring drivers to implement a json (or extended json) data type. Giving the ability to store JSON is a big DX win in my opinion.
Comment #31
daffie commentedComment #32
moshe weitzman commented+1 from me as well. Whats left before RTBC?
Comment #33
gábor hojtsyAs per the tags a release note snippet for the issue summary and a change record for people to have time to prepare would be needed :)
Comment #34
gábor hojtsyBTW looking at the proposed resolution to write up the change record, it seems like the proposed MySQL/MariaDB and PostgreSQL requirements are already in place in Drupal 9. So which database requirements are actually affected by this proposal?
Comment #35
mglamanThe main problem would be SQLite. Anything else are in contrib drivers
From the issue summary:
https://www.sqlite.org/json1.html
Comment #36
gábor hojtsyUpdating the issue summary to reflect the MySQL and PostgreSQL status as done in Drupal 9 already.
Comment #37
effulgentsia commentedPer #9, SQLite started compiling in the json1 extension by default starting with 3.24. Drupal 9 already requires 3.26.
This is a policy issue, but in terms of implementation, I think we'll want to add something to
Drupal\Core\Database\Install\Tasks, either concrete or abstract for drivers to implement, to test for json support. That would catch the case of a non-default compilation of SQLite that's missing the json1 extension, or contrib drivers that are missing the required capabilities.Comment #38
catchUpdated the issue summary based on #37.
Comment #39
daffie commentedNitpick IS update.
+1 from me for adding the json1 extension as required for SQLite in D10.
Comment #40
daffie commentedCreated the followup issue for adding the json1 extension requirements test in Drupal 10 for SQLite. See: #3192487: Warn about upcoming JSON database support requirement in Drupal 9.
Created the CR.
The issue is now for me RTBC.
Comment #41
catchComment #42
catchAdded a release notes snippet.
Comment #43
mradcliffeI added versions for Oracle and SQL Server to the change record.
I think eventually this would impact usages of Redis and Memcache. Does it make sense to mention that in this change record?
Comment #44
catch@mradcliffe if we implement/require JSON support in storage that has memcache/redis implementations we can add a change record in those issues with what needs to be done (if something does), I don't think we need to mention it yet when it's still theoretical.
Comment #45
catchI've moved #3192487: Warn about upcoming JSON database support requirement in Drupal 9 back to 9.2.x since I think we can do most of that issue in a minor release and then just tweak it for Drupal 10.
Since that follow-up is open, I think we can mark this fixed.