class CQL::Schema
Reference
< Object
The CQL::Schema
class represents a database schema. It provides methods to build and manage database schemas, including creating tables, executing SQL statements, and generating queries.
Example: Creating a New Schema
Methods
def define(name : Symbol, uri : String, &block)
Defines a new schema.
@param name [Symbol] The name of the schema.
@param uri [String] The URI of the database.
@yield [Schema] The schema being defined.
@return [Schema] The defined schema.
def table(name : Symbol, &block)
Creates a new table in the schema.
@param name [Symbol] The name of the table.
@yield [Table] The table being created.
@return [Table] The created table.
Example:
def exec(sql : String)
Executes a raw SQL statement.
@param sql [String] The SQL statement to execute.
@return [Nil]
Example: