Skip to content

sqlite: no support for "STRICT Tables" #1877

Closed
@trevorstarick

Description

@trevorstarick

Version

1.15.0

What happened?

I attempted to enable SQLite's strict table mode and was told that STRICT was an extraneous input. I believe a new token needs to be added to the lexer/parser to support strict tables, but there shouldn't need to be any work done on the generator side as SQLC doesn't handle table generation at the moment.

I believe errors should be thrown if the types used aren't from the following:

  • INT
  • INTEGER
  • REAL
  • TEXT
  • BLOB
  • ANY

as those are what are officially supported per the SQLite documentation: https://www.sqlite.org/stricttables.html

Relevant log output

line 3:2 extraneous input 'STRICT' expecting {<EOF>, ';', ALTER_, ANALYZE_, ATTACH_, BEGIN_, COMMIT_, CREATE_, DEFAULT_, DELETE_, DETACH_, DROP_, END_, EXPLAIN_, INSERT_, PRAGMA_, REINDEX_, RELEASE_, REPLACE_, ROLLBACK_, SAVEPOINT_, SELECT_, UPDATE_, VACUUM_, VALUES_, WITH_}

Database schema

CREATE TABLE foo (
	hash TEXT NOT NULL PRIMARY KEY
) STRICT;

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

Linux, macOS

What database engines are you using?

SQLite

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions