[−][src]Macro diesel_infer_schema::infer_table_from_schema
Diesel CLI can be configured to automatically run print-schema
after running migrations. See diesel.rs/guides/configuring-diesel-cli for details.
Establishes a database connection at compile time, loads the schema
information about a table's columns, and invokes
table!
for you automatically. For tables in a schema
other than the default, the table name should be given as
"schema_name.table_name"
.
Attempting to use the env!
or dotenv!
macros here will not work due to
limitations of the Macros 1.1 system, but you can pass a string in the form
"env:SOME_ENV_VAR"
or "dotenv:SOME_ENV_VAR"
to achieve the same effect.
At this time, the schema inference macros do not support types from third party crates, and having any columns with a type not supported by the diesel core crate will result in a compiler error (please open an issue if this happens unexpectedly for a type listed in our docs.)