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

strict schema for ARRAY during CREATE TABLE possible? #494

Open
Lercher opened this issue Feb 25, 2023 · 1 comment
Open

strict schema for ARRAY during CREATE TABLE possible? #494

Lercher opened this issue Feb 25, 2023 · 1 comment

Comments

@Lercher
Copy link

Lercher commented Feb 25, 2023

Version: require github.com/genjidb/genji v0.15.1

This is a question but probably also a feature request: Looking at the documentation, its syntax diagrams and the sqltests I found no way to provide a strict schema for the document- or primitive-type of an ARRAY. (How) can this be done?

The for me most natural way would be sth like this (think of a property list):

CREATE TABLE pl (
  name TEXT    PRIMARY KEY,
  contributors ARRAY [OF] TEXT,
  vals ARRAY [OF] (itemname TEXT, itemvalue INT)
)

Thanks,
Martin

@asdine
Copy link
Collaborator

asdine commented Jun 18, 2023

Indeed, as of today there are no ways to enforce an array elements to be of a certain type, but it is planned.

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