Skip to content

Support basic CREATE TABLE statements #3

@despawnerer

Description

@despawnerer

Tentative syntax:

create_table("Film")
    .columns((
        ("code", "char(5)").primary_key(),
        ("imdb_id", "char(40)").unique(),
        ("title", "varchar(40)").not_null(),
        ("did", "integer").not_null(),
        ("date_prod", "date"),
        ("kind", "varchar(10)"),
        ("len", "interval hour to minute").default("0"),
    ))
  • Duplicate or conflicting constraints on columns should not be allowed (i.e. doing .unique().unique() or .null().not_null(). Achievable at compile-time with some generics abuse.
  • Creating a statement without columns should not be allowed (also easily achievable at compile time)
  • Basic table constraints
    • UNIQUE
    • PRIMARY KEY (wonder if it would be possible to check that there's no primary key column at compile time?)
  • Basic indexes support
  • Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions