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

bool

auto_increment

false

Variant

default_value

null

String

name

""

bool

not_null

false

bool

primary_key

false

Variant.Type

type

0

bool

unique

false

Methods

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


Property Descriptions

bool auto_increment = false 🔗

  • void set_auto_increment(value: bool)

  • bool is_auto_increment()

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.


String name = "" 🔗

The name of the column.


bool not_null = false 🔗

  • void set_not_null(value: bool)

  • bool is_not_null()

If true, the column cannot contain NULL values.


bool primary_key = false 🔗

  • void set_primary_key(value: bool)

  • bool is_primary_key()

If true, the column is part of the table's primary key.


Variant.Type type = 0 🔗

The data type of the column, defined using Variant.Type.


bool unique = false 🔗

  • void set_unique(value: bool)

  • bool is_unique()

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.