Skip to content

Missing ; in the sql files fails silently #17

@BigBoyBarney

Description

@BigBoyBarney

Hi! Thank you for this shard!

So far, my experience with Drift has been nothing short of amazing. It's so effortless to use. Fantastic work!

A minor (skill) issue I ran into earlier was that I omitted a ; from the end of the statement, which then failed silently, both at compile time and then at run time.

Example:

-- drift:migrate
create table if not exists example (
  id integer primary key
) strict

-- drift:rollback
drop table if exists example;

The above will fail silently and do nothing at run time.

Example 2:

-- drift:migrate
create table if not exists example (
  id integer primary key
) strict

insert into example (id)
values (1);

-- drift:rollback
drop table if exists example;

The above will raise a SQLite3::Exception - Syntax Error at runtime.


These are all PEBCAK so they're not directly Drift related. I'm not entirely sure how feasible it would be, but it would be super cool if Drift did some compile time validation of the sql files.

If not, then I suppose I'll just have to pay more attention to the queries I write :P

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions