Skip to content

Export Database in SQL file : ERROR, Insert into generated column #2978

Description

@kanter

Details for the issue

What did you do?

Create a table
CREATE TABLE IF NOT EXISTS TestVector (
uid INTEGER,
price REAL,
num INTEGER,
total GENERATED ALWAYS AS (price*num) STORED
);

After export the database to SQL file, I can see the following:
INSERT INTO "spectacle_Commande" ("uid","price","num","total") VALUES (1,5.5,100,550);

What did you expect to see?

the total column should be excluded from the export file

What did you see instead?

When I import the sql file, an error occurs :
Résultat : cannot INSERT into generated column "total"

SAME Issue for
total GENERATED ALWAYS AS (price*num) VIRTUAL

Useful extra information

DB4S v3.12.2 [built for x86_64-little_endian-llp64] on Windows 10 (10.0) (winnt/10.0.18363) [x86_64]
using SQLCipher Version 4.4.0 community (based on SQLite 3.34.1)
and Qt 5.12.8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions