Skip to content

Instantly share code, notes, and snippets.

@petehunt

petehunt/bug.sql Secret

Created July 26, 2020 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petehunt/6a889fc8d01e14fb1667a1e7f9cb0ffd to your computer and use it in GitHub Desktop.
Save petehunt/6a889fc8d01e14fb1667a1e7f9cb0ffd to your computer and use it in GitHub Desktop.
create table first (id integer primary key);
create table second (id integer primary key);
import connect, { sql } from "@databases/sqlite";
async function main() {
const db = await connect();
await db.query(sql.file(__dirname + "/bug.sql"));
// Following line throws error: "SQLITE_ERROR: no such table: second"
await db.query(sql`select * from second`);
}
main().catch((e) => {
console.error(e);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment