php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79433 Update sqlite3 to support generated columns (3.31)
Submitted: 2020-03-30 10:48 UTC Modified: 2020-03-30 11:19 UTC
From: l33tengineer at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PDO SQLite
PHP Version: 7.4.4 OS: debian linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: l33tengineer at gmail dot com
New email:
PHP Version: OS:

 

 [2020-03-30 10:48 UTC] l33tengineer at gmail dot com
Description:
------------
Generated column support was added with SQLite version 3.31.0 (2020-01-22).
Php does not yet support this version and with it the generated column syntax.

I'd like to propose an update to the sqlite extension to allow for the generated column syntax as described in https://sqlite.org/gencol.html.
Creating an (in-memory) sqlite database with `GENERATED ALWAYS AS` sql now gives a syntax error.

Test script:
---------------
<?php
$db = new \PDO('sqlite::memory:');
$sql = <<<SQL
CREATE TABLE t1(
   a INTEGER PRIMARY KEY,
   b INT,
   c TEXT,
   d INT GENERATED ALWAYS AS (a*abs(b)) VIRTUAL,
   e TEXT GENERATED ALWAYS AS (substr(c,b,b+1)) STORED
);
SQL;
$result = $db->exec($sql);
var_dump($result);
var_dump($db->errorInfo());


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-30 11:19 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-03-30 11:19 UTC] cmb@php.net
As of PHP 7.4.0, libsqlite3 is no longer bundled, so this request
makes no sense.  You just have to compile PHP with a recent
libsqlite3.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC