SQLiteColumnSchema
Inherits: RefCounted < Object
Represents the schema definition of a database column.
Description
Describes a single column in a database table, including its name, type, constraints, and default value.
This class is used when defining or inspecting table schemas.
Properties
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods
create(name: String, type: Variant.Type = 4, default_value: Variant = null, primary_key: bool = false, auto_increment: bool = false, not_null: bool = false, unique: bool = false) static |
Property Descriptions
If true, the column value is automatically incremented for each new row.
Variant default_value = null 🔗
The default value assigned to the column when no value is provided.
The name of the column.
If true, the column cannot contain NULL values.
If true, the column is part of the table's primary key.
Variant.Type type = 0 🔗
void set_type(value: Variant.Type)
Variant.Type get_type()
The data type of the column, defined using Variant.Type.
If true, all values in the column must be unique.
Method Descriptions
SQLiteColumnSchema create(name: String, type: Variant.Type = 4, default_value: Variant = null, primary_key: bool = false, auto_increment: bool = false, not_null: bool = false, unique: bool = false) static 🔗
Creates and returns a new SQLiteColumnSchema instance with the specified properties.
The column name is defined by name, and its data type is given by type using Variant.Type.
The default_value is used when no explicit value is provided during insertion.
If primary_key is true, the column is marked as the table's primary key.
Enabling auto_increment makes the column automatically increment for each inserted row (typically used with integer primary keys).
If not_null is true, the column cannot contain NULL values.
If unique is true, all values in the column must be distinct.