Crate sfo_sql

source ·

Modules§

  • SEE DOCUMENTATION BEFORE USE. Runtime-generic database driver.
  • Traits to represent a database driver.
  • Provides Decode for decoding values from the database.
  • Provides Encode for encoding values for the database.
  • Types for working with errors produced by SQLx.
  • Provides the connection pool for asynchronous SQLx connections.
  • Convenience re-export of common traits.
  • Types and traits for the query family of functions and macros.
  • Runtime query-builder API.
  • Conversions between Rust and SQL types.

Macros§

  • Embeds migrations into the binary by expanding to a static instance of Migrator.
  • Statically checked SQL query with println!() style syntax.
  • A variant of query! which takes a path to an explicitly defined struct as the output type.
  • A variant of query_as! which does not check the input or output types. This still does parse the query to ensure it’s syntactically and semantically valid for the current database.
  • A variant of query! where the SQL query is stored in a separate file.
  • Combines the syntaxes of query_as! and query_file!.
  • A variant of query_file_as! which does not check the input or output types. This still does parse the query to ensure it’s syntactically and semantically valid for the current database.
  • A variant of query_scalar! which takes a file path like query_file!.
  • A variant of query_file_scalar! which does not typecheck bind parameters and leaves the output type to inference. The query itself is still checked that it is syntactically and semantically valid for the database, that it only produces one column and that the number of bind parameters is correct.
  • A variant of query_file! which does not check the input or output types. This still does parse the query to ensure it’s syntactically and semantically valid for the current database.
  • A variant of query! which expects a single column from the query and evaluates to an instance of QueryScalar.
  • A variant of query_scalar! which does not typecheck bind parameters and leaves the output type to inference. The query itself is still checked that it is syntactically and semantically valid for the database, that it only produces one column and that the number of bind parameters is correct.
  • A variant of query! which does not check the input or output types. This still does parse the query to ensure it’s syntactically and semantically valid for the current database.

Structs§

  • Opaque database driver. Capable of being used in place of any SQLx database driver. The actual driver used will be selected at runtime, from the connection url.
  • A connection to any SQLx database.
  • MySQL database driver.
  • A connection to a MySQL database.
  • An asynchronous pool of SQLx database connections.
  • A builder type for constructing queries at runtime.
  • One or more raw SQL statements, separated by semicolons (;).
  • An in-progress database transaction or savepoint.

Enums§

  • The enum Either with variants Left and Right is a general purpose sum type with two cases.
  • Represents all the ways a method can fail within SQLx.

Traits§

Functions§

  • Same as query_scalar_with but takes arguments as Result
  • Same as query_with but is initialized with a Result of arguments instead
  • Execute a single SQL query as a prepared statement (transparently cached).
  • Execute a single SQL query as a prepared statement (transparently cached). Maps rows to Rust types using FromRow.
  • Execute a single SQL query, with the given arguments as a prepared statement (transparently cached). Maps rows to Rust types using FromRow.
  • Execute a single SQL query as a prepared statement (transparently cached) and extract the first column of each row.
  • Execute a SQL query as a prepared statement (transparently cached), with the given arguments, and extract the first column of each row.
  • Execute a SQL query as a prepared statement (transparently cached), with the given arguments.
  • Execute one or more statements as raw SQL, separated by semicolons (;).

Type Aliases§

Attribute Macros§

Derive Macros§