pub struct Sqlite { /* private fields */ }Expand description
The SQLite schema: backtick quoting, INTEGER PRIMARY KEY AUTOINCREMENT
inline, TEXT for most types, DELETE FROM for truncation.
use utopia_query::schema::{Schema, Sqlite};
let mut table = Sqlite::new().table("notes");
table.id("id");
table.text("body");
assert_eq!(
table.create()?.query,
"CREATE TABLE `notes` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `body` TEXT NOT NULL)"
);use Utopia\Query\Schema\SQLite;
$table = (new SQLite())->table('notes');
$table->id();
$table->text('body');
echo $table->create()->query, "\n";PHP: Utopia\Query\Schema\SQLite.
Implementations§
Trait Implementations§
impl AutoIncrement for Sqlite
impl Checks for Sqlite
impl Collation for Sqlite
impl ColumnAlterations for Sqlite
impl Comment for Sqlite
impl CompositePrimary for Sqlite
impl Generated for Sqlite
impl InlineForeignKey for Sqlite
Source§impl Schema for Sqlite
impl Schema for Sqlite
Source§fn compile_column_definition(&self, column: &Column<Self>) -> Result<String>
fn compile_column_definition(&self, column: &Column<Self>) -> Result<String>
An auto-incrementing primary key is INTEGER PRIMARY KEY AUTOINCREMENT inline; other columns compile as usual.
Source§fn compile_create(
&self,
table: &Table<Self>,
if_not_exists: bool,
) -> Result<Statement>
fn compile_create( &self, table: &Table<Self>, if_not_exists: bool, ) -> Result<Statement>
Without the trailing PRIMARY KEY (...) clause when a column carries
its key inline.
Source§fn set_executor(&mut self, executor: Executor) -> &mut Self
fn set_executor(&mut self, executor: Executor) -> &mut Self
Sets the executor every statement compiled from now on carries
(
Statement::execute runs it). Read moreSource§fn literal(&self) -> StringLiteral
fn literal(&self) -> StringLiteral
How the dialect writes a string literal: comments, defaults and enum
values are inlined, since DDL takes no bound parameters. Read more
Source§fn quote(&self, identifier: &str) -> Result<String>
fn quote(&self, identifier: &str) -> Result<String>
Quotes a possibly qualified identifier. Read more
Source§fn quote_literal(&self, identifier: &str) -> Result<String>
fn quote_literal(&self, identifier: &str) -> Result<String>
Quotes one identifier, dots included. Read more
Source§fn compile_column_type(&self, column: &Column<Self>) -> Result<String>
fn compile_column_type(&self, column: &Column<Self>) -> Result<String>
The SQL type of
column. Read moreSource§fn compile_auto_increment(&self) -> &'static str
fn compile_auto_increment(&self) -> &'static str
The auto-increment keyword. Read more
Source§fn compile_unsigned(&self) -> &'static str
fn compile_unsigned(&self) -> &'static str
The unsigned keyword, or empty where there is none. Read more
Source§fn table(&self, name: impl Into<String>) -> Table<Self>
fn table(&self, name: impl Into<String>) -> Table<Self>
A blueprint of table
name compiled by this schema. Read moreSource§fn compile_drop(&self, name: &str, if_exists: bool) -> Result<Statement>
fn compile_drop(&self, name: &str, if_exists: bool) -> Result<Statement>
DROP TABLE [IF EXISTS] name. Read moreSource§fn create_index(
&self,
table: &str,
name: &str,
columns: &[&str],
options: &IndexOptions,
) -> Result<Statement>
fn create_index( &self, table: &str, name: &str, columns: &[&str], options: &IndexOptions, ) -> Result<Statement>
Source§fn compile_generated_clause(&self, column: &Column<Self>) -> String
fn compile_generated_clause(&self, column: &Column<Self>) -> String
GENERATED ALWAYS AS (...) STORED|VIRTUAL. Read moreSource§fn compile_create_suffix(&self, _table: &Table<Self>) -> String
fn compile_create_suffix(&self, _table: &Table<Self>) -> String
Clauses after the column list of
CREATE TABLE (partitioning). Read moreimpl Serial for Sqlite
impl Unique for Sqlite
impl VirtualGenerated for Sqlite
Auto Trait Implementations§
impl !RefUnwindSafe for Sqlite
impl !UnwindSafe for Sqlite
impl Forget for Sqlite
impl Freeze for Sqlite
impl Move for Sqlite
impl Send for Sqlite
impl Sync for Sqlite
impl Unpin for Sqlite
impl UnsafeUnpin for Sqlite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more