Various rules regarding deploying Kwil databases
All names for Kwil database items (names for tables, columns, roles, indexes, databases, etc.) must begin with a letter. Furthermore, the names must only contain letters, numbers, and underscores. Names are not case sensitive.
Names are also constricted by length. See the chart below for specific items, and what their maximum length is:
Kwil supports a restricted set of data types compared to other relational databases. We are constantly building support for more. If there is a data type your application would like to see added, please let us know! Below is a list of currently supported data types
Can't be greater than 1024 characters
Signed 32-bit Integer
Signed 64-bit Integer
Must be RFC-4122 compliant UUID
Note that for any data-type value you pass into the CLI via a JSON database structure, you will need to encode it.
Attributes refer to a the properties and constraints of a column. A column can have multiple attributes. Some attributes require values to be defined with them. Below is a list of supported attributes:
Defines a table column as a primary key. Only one column per table can have this attribute.
Every value in this column must be unique. Inserts/Updates violating a column's uniqueness will fail. This also automatically creates an index on the column.
This column can not be null. Any transaction that makes this column null will be rejected.
If a value is not provided for this column in a transaction, then the specified value will be defaulted to.
This specifies a minimum value for a column. Transactions violating this constraint will fail. This column must be either an int32 or int64.
This specifies a maximum value for a column. Transactions violating this constraint will fail. This column must be either an int32 or int64.
This specifies a minimum length for a column. This column must be a string type.
This specifies a maximum length for a column. This column must be a string type.
Modifiers are special functions that alter a query input at execution time. An example of a modifier is "caller", which replaces the query input with the address of the function caller (similar to Solidity's msg.sender). Only one modifier can be added to a given input, however they are not required.
No modifier is present on the column.
Replaces the input with the caller's address.
The input must be set to static and have a nil default value.
Comparison operators are used to dictate sorting and selection behavior for where-clauses. A single comparison operator can be assigned to a single where-clause, however multiple where-clauses can be chained together.
Greater Than or Equal
Less Than or Equal
Query types are used to specify the action of a query. Currently, Kwil supports 3 query types:
Creates a new row.
Updates row(s) value(s) based on a set of where-clauses.
Deletes row(s) based on a set of where-clauses.
Index types specify the how indexes are created and sorted.