• TootSweet@lemmy.world
    link
    fedilink
    English
    arrow-up
    45
    ·
    15 hours ago
    create table boolean (
      id integer primary key,
      name text not null unique
    )
    insert into boolean (name) values ('true');
    insert into boolean (name) values ('false');
    create table document (
      id integer primary key,
      name text not null unique,
      body text not null,
      is_archived not null integer,
      foreign key (is_archived) references boolean (id)
        on delete cascade
        on update no action
    );
    

    Solved.

    Bonus: DBAs hate this one weird trick that can free up incredible amounts of disk space by deleting just two rows.

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    43
    ·
    16 hours ago

    I think you got the wrong caption. It’s the world if SQLite supported multiple concurent writes.

    Stupid transaction deadlocks…

    • dan@upvote.au
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      9 hours ago

      WAL mode makes writes a lot faster, which is sufficient for a bunch of use cases. Writers do still need to wait, but they have to wait for a shorter duration. It’s still not the right choice for write-heavy use cases, of course.

      • RustyNova@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 hour ago

        I’m not actually looking for the speed most of the time, but more about preventing partial writes, so I’m still using it

  • lambisio@feddit.cl
    link
    fedilink
    English
    arrow-up
    2
    ·
    12 hours ago

    I can live without Booleans I think… what saddens me more than nothing else is the lack of more proper treatment for Decimal-like types.