Jan
18
1 day ago
started
started time in 3 hours ago
Activity icon
issue

weiznich issue diesel-rs/diesel

weiznich
weiznich

Diesel doesn't see sqlite generated columns

Setup

Setup a project with sqlite using the following up.sql:

create table example (
    id integer not null primary key,
    calculated integer generated always as (id*2)
);

Versions

  • Rust: 1.56.0 nightly
  • Diesel: 1.4.7
  • Database: Sqlite
  • Operating System Linux

Feature Flags

  • diesel: sqlite

Problem Description

Sqlite doesn't include generated columns in pragma table_info(table); only in pragma table_xinfo(table);. Therefore they do not show up in the schema.

What are you trying to accomplish?

Use generated columns.

Are you seeing any additional errors?

No

Checklist

  • I have already looked over the issue tracker and the disussion forum for similar possible closed issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be closed if this is not the case)
  • This issue can be reproduced without requiring a third party crate
Activity icon
issue

weiznich issue comment diesel-rs/diesel

weiznich
weiznich

Diesel doesn't see sqlite generated columns

Setup

Setup a project with sqlite using the following up.sql:

create table example (
    id integer not null primary key,
    calculated integer generated always as (id*2)
);

Versions

  • Rust: 1.56.0 nightly
  • Diesel: 1.4.7
  • Database: Sqlite
  • Operating System Linux

Feature Flags

  • diesel: sqlite

Problem Description

Sqlite doesn't include generated columns in pragma table_info(table); only in pragma table_xinfo(table);. Therefore they do not show up in the schema.

What are you trying to accomplish?

Use generated columns.

Are you seeing any additional errors?

No

Checklist

  • I have already looked over the issue tracker and the disussion forum for similar possible closed issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be closed if this is not the case)
  • This issue can be reproduced without requiring a third party crate
push

weiznich push diesel-rs/diesel

weiznich
weiznich

Handle 'generated always' as type in sqlite <3.37

weiznich
weiznich

Added version check to table_xinfo

weiznich
weiznich

Added comment about hidden columns

weiznich
weiznich

Merge pull request #2916 from gorbit99/master

Added generated column support for sqlite when the type is specified

commit sha: bdd008c97b53957329ef2cae0504739e76dd3860

push time in 4 hours ago
pull request

weiznich pull request diesel-rs/diesel

weiznich
weiznich

Added generated column support for sqlite when the type is specified

This is a WIP pr for issue #2912. Adds in support for generated columns in sqlite, if they are written like this:

generated integer as (id * 3)
open pull request

gorbit99 wants to merge diesel-rs/diesel

gorbit99
gorbit99

Added generated column support for sqlite when the type is specified

This is a WIP pr for issue #2912. Adds in support for generated columns in sqlite, if they are written like this:

generated integer as (id * 3)
gorbit99
gorbit99

Added one, is this alright?

pull request

gorbit99 merge to diesel-rs/diesel

gorbit99
gorbit99

Added generated column support for sqlite when the type is specified

This is a WIP pr for issue #2912. Adds in support for generated columns in sqlite, if they are written like this:

generated integer as (id * 3)
open pull request

weiznich wants to merge diesel-rs/diesel

weiznich
weiznich

Added generated column support for sqlite when the type is specified

This is a WIP pr for issue #2912. Adds in support for generated columns in sqlite, if they are written like this:

generated integer as (id * 3)
weiznich
weiznich

Ah, I remember that now. Can we add a comment there, so that this don't happen again?

pull request

weiznich merge to diesel-rs/diesel

weiznich
weiznich

Added generated column support for sqlite when the type is specified

This is a WIP pr for issue #2912. Adds in support for generated columns in sqlite, if they are written like this:

generated integer as (id * 3)
Previous