chai icon indicating copy to clipboard operation
chai copied to clipboard

strict schema for ARRAY during CREATE TABLE possible?

Open Lercher opened this issue 1 year ago • 1 comments

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

Lercher avatar Feb 25 '23 17:02 Lercher

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

asdine avatar Jun 18 '23 10:06 asdine