~spacekookie/public-inbox

barrel 0.7.0 puts a semicolon in ALTER TABLE for indexes in Sqlite

Details
Message ID
<2C62A937-A22B-49FA-B199-8379B5E75B47@brianthicks.com>
DKIM signature
missing
Download raw message
Hey there! I’m using Barrel 0.7.0 and have found a problem while adding a table.

Here’s the code I have:

    use barrel::backend::Sqlite;
    use barrel::{types, Migration};

    pub fn migration() -> String {
        let mut m = Migration::new();

        m.change_table("items", |t| {
            t.add_index("idx_next", types::index(&["next"]))
        });

        m.make::<Sqlite>()
    }

this outputs the following SQL:

    ALTER TABLE "items" ;CREATE  INDEX "idx_next" ON "items" ("next”);

note the interior semicolon. Sqlite doesn’t accept this, of course.

Not a huge rush to fix from my perspective, but I thought you should know!
Reply to thread Export thread (mbox)