Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

once we hit an error state... things fall apart? #38

Open
tantaman opened this issue Aug 18, 2023 · 3 comments
Open

once we hit an error state... things fall apart? #38

tantaman opened this issue Aug 18, 2023 · 3 comments

Comments

@tantaman
Copy link
Contributor

Can't seem to recover when a schema or query are in error in the same file

@tantaman
Copy link
Contributor Author

export const StrutSchema = schema<StrutSchemaType>`
CREATE TABLE IF NOT EXISTS deck (
  id 'IID_of<StrutSchemaType["deck"]>' PRIMARY KEY NOT NULL,
  title TEXT DEFAULT 'Untitled',
  created INT,
  modified INT,
  theme_id 'IID_of<StrutSchemaType["theme"]>',
  chosen_presenter TEXT DEFAULT 'impress'
);

CREATE TABLE IF NOT EXISTS theme (
  id 'IID_of<StrutSchemaType["theme"]>' PRIMARY KEY NOT NULL
);
`;

StrutSchema.sql<{
  id: IID_of<StrutSchemaType["deck"]>;
  title: string | null;
  created: number | null;
  modified: number | null;
  theme_id: IID_of<StrutSchemaType["theme"]> | null;
  chosen_presenter: string | null;
}>`SELECT * FROM deck`;

removing the ; from the end of the deck table creation puts us in a bad state.

@tantaman
Copy link
Contributor Author

I thin I fixed this in 5657b86 but need to retest

@jlarmstrongiv
Copy link
Contributor

I did run into a few places in the playground where the error isn’t immediately clear, but everything worked after I found and fixed incorrect queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants