#[must_use = "Queries are only executed when calling `load`, `get_result` or similar."]
pub struct IncompleteInsertStatement<T, Op> { /* fields omitted */ }
Inserts DEFAULT VALUES
into the targeted table.
connection.execute("CREATE TABLE users (
name VARCHAR(255) NOT NULL DEFAULT 'Sean',
hair_color VARCHAR(255) NOT NULL DEFAULT 'Green'
)")?;
insert_into(users)
.default_values()
.execute(&connection)
.unwrap();
let inserted_user = users.first(&connection)?;
let expected_data = (String::from("Sean"), String::from("Green"));
assert_eq!(expected_data, inserted_user);
Inserts the given values into the table passed to insert_into
.
See the documentation of insert_into
for
usage examples.
This method can sometimes produce extremely opaque error messages due to
limitations of the Rust language. If you receive an error about
"overflow evaluating requirement" as a result of calling this method,
you may need an &
in front of the argument to this method.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Convert self
to an expression for Diesel's query builder. Read more
Convert &self
to an expression for Diesel's query builder. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static