Skip to content

SQLite: does not recognize hidden columns #324

@JanKalach

Description

@JanKalach

Version: 3.2.8

Bug Description

SQLiteDriver does not recognize hidden columns and returns only visible columns.

Steps To Reproduce

  1. Create table with virtual column
CREATE TABLE produkty (
    id INTEGER PRIMARY KEY,
    cena REAL,
    mnozstvi INTEGER,
    -- Virtual column
    celkem REAL GENERATED ALWAYS AS (cena * mnozstvi) VIRTUAL,
);
  1. Reload database structure. SQLiteDriver returns only 3 columns.

Expected Behavior

Should return all existing columns from table

Possible Solution

https://sqlite.org/pragma.html#pragma_table_info
\Nette\Database\Drivers\SqliteDriver::getColumns (152)

$rows = $this->connection->query("PRAGMA table_xinfo({$this->delimite($table)})");

Using table_xinfo instead table_info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions