{"id":21983921,"url":"https://github.com/sqlpage/sqlx-oldapi","last_synced_at":"2025-12-12T13:04:14.104Z","repository":{"id":66344318,"uuid":"498447897","full_name":"sqlpage/sqlx-oldapi","owner":"sqlpage","description":"Fork of sqlx. 🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.","archived":false,"fork":true,"pushed_at":"2024-11-20T22:25:53.000Z","size":7488,"stargazers_count":49,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-26T22:18:10.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"launchbadge/sqlx","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqlpage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-05-31T18:13:57.000Z","updated_at":"2024-11-20T22:11:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d5a7ec9-95f7-440c-91e1-7a7b2533a718","html_url":"https://github.com/sqlpage/sqlx-oldapi","commit_stats":null,"previous_names":["lovasoa/sqlx","sqlpage/sqlx-oldapi"],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2Fsqlx-oldapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2Fsqlx-oldapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2Fsqlx-oldapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlpage%2Fsqlx-oldapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlpage","download_url":"https://codeload.github.com/sqlpage/sqlx-oldapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227184348,"owners_count":17744223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T18:02:10.574Z","updated_at":"2025-12-12T13:04:14.097Z","avatar_url":"https://github.com/sqlpage.png","language":"Rust","readme":"\u003e This is a fork of the original [sqlx](https://github.com/launchbadge/sqlx) library by @launchbadge.\n\u003e sqlx v0.7 broke backwards compatibility with v0.6 in a way that makes it difficult to upgrade.\n\u003e sqlx v0.7 also removed support for Microsoft SQL Server (to sell it as a separate commercial product).\n\u003e This fork is intended to be a drop-in replacement for sqlx v0.6, with the following changes:\n\u003e - Added support for ODBC.\n\u003e - Updated to use the latest versions of dependencies, including\n\u003e    - All missing security updates\n\u003e    - Latest SQLite version\n\u003e - Improved support for Microsoft SQL Server, including:\n\u003e     -   Support for reading and writing `binary` and `varbinary` data\n\u003e     -   Support for reading and writing  \n\u003e          - `numeric`, `decimal`,\n\u003e          - `date`, `datetime`, and `datetimeoffset` data (using the `chrono` feature),\n\u003e          - `uuid` data (using the `uuid` feature),\n\u003e     -   Multiple bug fixes around string handling, including better support for long strings\n\u003e     -   Support for packet chunking, which fixes a bug where large bound parameters or large queries would fail\n\u003e     -   Support for TLS encrypted connections\n\u003e     -   Support for named instances with automatic port discovery via SSRP\n\u003e \n\u003e The main use case driving the development of sqlx-oldapi is the [SQLPage](https://sql.datapage.app/) SQL-only rapid application building tool.\n\n\u003ch1 align=\"center\"\u003eSQLx\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n \u003cstrong\u003e\n   🧰 The Rust SQL Toolkit\n \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Github Actions --\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/lovasoa/sqlx/sqlx.yml?branch=main\" alt=\"actions status\" /\u003e\n  \u003c!-- Version --\u003e\n  \u003ca href=\"https://crates.io/crates/sqlx-oldapi\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/sqlx-oldapi.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Docs --\u003e\n  \u003ca href=\"https://docs.rs/sqlx-oldapi\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\"\n      alt=\"docs.rs docs\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/sqlx-oldapi\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/sqlx-oldapi.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch4\u003e\n    \u003ca href=\"#install\"\u003e\n      Install\n    \u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"#usage\"\u003e\n      Usage\n    \u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://docs.rs/sqlx-oldapi\"\u003e\n      Docs\n    \u003c/a\u003e\n  \u003c/h4\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch5\u003eHave a question? Be sure to \u003ca href=\"FAQ.md\"\u003echeck the FAQ first!\u003c/a\u003e\u003c/h5\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\nSQLx is an async, pure Rust\u003csub\u003e†\u003c/sub\u003e SQL crate featuring compile-time checked queries without a DSL.\n\n-   **Truly Asynchronous**. Built from the ground-up using async/await for maximum concurrency.\n\n-   **Compile-time checked queries** (if you want). See [SQLx is not an ORM](#sqlx-is-not-an-orm).\n\n-   **Database Agnostic**. Support for [PostgreSQL], [MySQL], [SQLite], [MSSQL], and [ODBC].\n\n-   **Pure Rust**. The Postgres and MySQL/MariaDB drivers are written in pure Rust using **zero** unsafe\u003csub\u003e††\u003c/sub\u003e code.\n\n-   **Runtime Agnostic**. Works on different runtimes ([`async-std`] / [`tokio`] / [`actix`]) and TLS backends ([`native-tls`], [`rustls`]).\n\n\u003csmall\u003e\u003csmall\u003e\n\n† The SQLite driver uses the libsqlite3 C library as SQLite is an embedded database (the only way\nwe could be pure Rust for SQLite is by porting _all_ of SQLite to Rust).\n\n†† SQLx uses `#![forbid(unsafe_code)]` unless the `sqlite` feature is enabled. As the SQLite driver interacts\nwith C, those interactions are `unsafe`.\n\n\u003c/small\u003e\u003c/small\u003e\n\n[postgresql]: http://postgresql.org/\n[sqlite]: https://sqlite.org/\n[mysql]: https://www.mysql.com/\n[mssql]: https://www.microsoft.com/en-us/sql-server\n[odbc]: https://docs.microsoft.com/en-us/sql/odbc/\n\n---\n\n-   Cross-platform. Being native Rust, SQLx will compile anywhere Rust is supported.\n\n-   Built-in connection pooling with `sqlx::Pool`.\n\n-   Row streaming. Data is read asynchronously from the database and decoded on-demand.\n\n-   Automatic statement preparation and caching. When using the high-level query API (`sqlx::query`), statements are\n    prepared and cached per-connection.\n\n-   Simple (unprepared) query execution including fetching results into the same `Row` types used by\n    the high-level API. Supports batch execution and returning results from all statements.\n\n-   Transport Layer Security (TLS) where supported ([MySQL] and [PostgreSQL]).\n\n-   Asynchronous notifications using `LISTEN` and `NOTIFY` for [PostgreSQL].\n\n-   Nested transactions with support for save points.\n\n-   `Any` database driver for changing the database driver at runtime. An `AnyPool` connects to the driver indicated by the URL scheme.\n\n## Install\n\nSQLx is compatible with the [`async-std`], [`tokio`] and [`actix`] runtimes; and, the [`native-tls`] and [`rustls`] TLS backends. When adding the dependency, you must chose a runtime feature that is `runtime` + `tls`.\n\n[`async-std`]: https://github.com/async-rs/async-std\n[`tokio`]: https://github.com/tokio-rs/tokio\n[`actix`]: https://github.com/actix/actix-net\n[`native-tls`]: https://crates.io/crates/native-tls\n[`rustls`]: https://crates.io/crates/rustls\n\n```toml\n# Cargo.toml\n[dependencies]\n# tokio + rustls\nsqlx-oldapi = { version = \"0.6\", features = [ \"runtime-tokio-rustls\" ] }\n# async-std + native-tls\nsqlx-oldapi = { version = \"0.6\", features = [ \"runtime-async-std-native-tls\" ] }\n```\n\n\u003csmall\u003e\u003csmall\u003eThe runtime and TLS backend not being separate feature sets to select is a workaround for a [Cargo issue](https://github.com/rust-lang/cargo/issues/3494).\u003c/small\u003e\u003c/small\u003e\n\n#### Cargo Feature Flags\n\n-   `runtime-async-std-native-tls`: Use the `async-std` runtime and `native-tls` TLS backend.\n\n-   `runtime-async-std-rustls`: Use the `async-std` runtime and `rustls` TLS backend.\n\n-   `runtime-tokio-native-tls`: Use the `tokio` runtime and `native-tls` TLS backend.\n\n-   `runtime-tokio-rustls`: Use the `tokio` runtime and `rustls` TLS backend.\n\n-   `runtime-actix-native-tls`: Use the `actix` runtime and `native-tls` TLS backend.\n\n-   `runtime-actix-rustls`: Use the `actix` runtime and `rustls` TLS backend.\n\n-   `postgres`: Add support for the Postgres database server.\n\n-   `mysql`: Add support for the MySQL/MariaDB database server.\n\n-   `mssql`: Add support for the MSSQL database server.\n\n-   `sqlite`: Add support for the self-contained [SQLite](https://sqlite.org/) database engine.\n\n-   `odbc`: Add support for ODBC database connections.\n\n-   `any`: Add support for the `Any` database driver, which can proxy to a database driver at runtime.\n\n-   `macros`: Add support for the `query*!` macros, which allow compile-time checked queries.\n\n-   `migrate`: Add support for the migration management and `migrate!` macro, which allow compile-time embedded migrations.\n\n-   `uuid`: Add support for UUID (in Postgres).\n\n-   `chrono`: Add support for date and time types from `chrono`.\n\n-   `time`: Add support for date and time types from `time` crate (alternative to `chrono`, which is preferred by `query!` macro, if both enabled)\n\n-   `bstr`: Add support for `bstr::BString`.\n\n-   `git2`: Add support for `git2::Oid`.\n\n-   `bigdecimal`: Add support for `NUMERIC` using the `bigdecimal` crate.\n\n-   `decimal`: Add support for `NUMERIC` using the `rust_decimal` crate.\n\n-   `ipnetwork`: Add support for `INET` and `CIDR` (in postgres) using the `ipnetwork` crate.\n\n-   `json`: Add support for `JSON` and `JSONB` (in postgres) using the `serde_json` crate.\n\n-   `tls`: Add support for TLS connections.\n\n-   `offline`: Enables building the macros in offline mode when a live database is not available (such as CI). \n    -   Requires `sqlx-cli` installed to use. See [sqlx-cli/README.md][readme-offline].\n\n[readme-offline]: sqlx-cli/README.md#enable-building-in-offline-mode-with-query\n\n## SQLx is not an ORM!\n\nSQLx supports **compile-time checked queries**. It does not, however, do this by providing a Rust\nAPI or DSL (domain-specific language) for building queries. Instead, it provides macros that take\nregular SQL as an input and ensure that it is valid for your database. The way this works is that\nSQLx connects to your development DB at compile time to have the database itself verify (and return\nsome info on) your SQL queries. This has some potentially surprising implications:\n\n- Since SQLx never has to parse the SQL string itself, any syntax that the development DB accepts\n  can be used (including things added by database extensions)\n- Due to the different amount of information databases let you retrieve about queries, the extent of\n  SQL verification you get from the query macros depends on the database\n\n**If you are looking for an (asynchronous) ORM,** you can check out [`ormx`] or [`SeaORM`], which is built on top\nof SQLx.\n\n[`ormx`]: https://crates.io/crates/ormx\n[`SeaORM`]: https://github.com/SeaQL/sea-orm\n## Usage\n\nSee the `examples/` folder for more in-depth usage.\n\n### Quickstart\n\n```toml\n[dependencies]\n# PICK ONE:\n# Async-std:\nsqlx-oldapi = { version = \"0.6\", features = [  \"runtime-async-std-native-tls\", \"postgres\" ] }\nasync-std = { version = \"1\", features = [ \"attributes\" ] }\n\n# Tokio:\nsqlx-oldapi = { version = \"0.6\", features = [ \"runtime-tokio-native-tls\" , \"postgres\" ] }\ntokio = { version = \"1\", features = [\"full\"] }\n\n# Actix-web:\nsqlx-oldapi = { version = \"0.6\", features = [ \"runtime-actix-native-tls\" , \"postgres\" ] }\nactix-web = \"4\"\n```\n\n```rust\nuse sqlx_oldapi::postgres::PgPoolOptions;\nuse sqlx_oldapi::{query, query_as, query_as_unchecked, query_scalar, query_with};\n// use sqlx_oldapi::mysql::MySqlPoolOptions;\n// etc.\n\n#[async_std::main]\n// or #[tokio::main]\n// or #[actix_web::main]\nasync fn main() -\u003e Result\u003c(), sqlx_oldapi::Error\u003e {\n    // Create a connection pool\n    //  for MySQL, use MySqlPoolOptions::new()\n    //  for SQLite, use SqlitePoolOptions::new()\n    //  for ODBC, use OdbcPoolOptions::new()\n    //  etc.\n    let pool = PgPoolOptions::new()\n        .max_connections(5)\n        .connect(\"postgres://postgres:password@localhost/test\").await?;\n\n    // Make a simple query to return the given parameter (use a question mark `?` instead of `$1` for MySQL)\n    let row: (i64,) = query_as(\"SELECT $1\")\n        .bind(150_i64)\n        .fetch_one(\u0026pool).await?;\n\n    assert_eq!(row.0, 150);\n\n    Ok(())\n}\n```\n\n### Connecting\n\nA single connection can be established using any of the database connection types and calling `connect()`.\n\n```rust\nuse sqlx_oldapi::Connection;\n\nlet conn = SqliteConnection::connect(\"sqlite::memory:\").await?;\n```\n\nGenerally, you will want to instead create a connection pool (`sqlx_oldapi::Pool`) in order for your application to\nregulate how many server-side connections it's using.\n\n```rust\nlet pool = MySqlPool::connect(\"mysql://user:pass@host/database\").await?;\n```\n\n### Querying\n\nIn SQL, queries can be separated into prepared (parameterized) or unprepared (simple). Prepared queries have their\nquery plan _cached_, use a binary mode of communication (lower bandwidth and faster decoding), and utilize parameters\nto avoid SQL injection. Unprepared queries are simple and intended only for use case where a prepared statement\nwill not work, such as various database commands (e.g., `PRAGMA` or `SET` or `BEGIN`).\n\nSQLx supports all operations with both types of queries. In SQLx, a `\u0026str` is treated as an unprepared query\nand a `Query` or `QueryAs` struct is treated as a prepared query.\n\n```rust\n// low-level, Executor trait\nconn.execute(\"BEGIN\").await?; // unprepared, simple query\nconn.execute(query(\"DELETE FROM table\")).await?; // prepared, cached query\n```\n\nWe should prefer to use the high level, `query` interface whenever possible. To make this easier, there are finalizers\non the type to avoid the need to wrap with an executor.\n\n```rust\nquery(\"DELETE FROM table\").execute(\u0026mut conn).await?;\nquery(\"DELETE FROM table\").execute(\u0026pool).await?;\n```\n\nThe `execute` query finalizer returns the number of affected rows, if any, and drops all received results.\nIn addition, there are `fetch`, `fetch_one`, `fetch_optional`, and `fetch_all` to receive results.\n\nThe `Query` type returned from `query` will return `Row\u003c'conn\u003e` from the database. Column values can be accessed\nby ordinal or by name with `row.get()`. As the `Row` retains an immutable borrow on the connection, only one\n`Row` may exist at a time.\n\nThe `fetch` query finalizer returns a stream-like type that iterates through the rows in the result sets.\n\n```rust\n// provides `try_next`\nuse futures::TryStreamExt;\n\nlet mut rows = query(\"SELECT * FROM users WHERE email = ?\")\n    .bind(email)\n    .fetch(\u0026mut conn);\n\nwhile let Some(row) = rows.try_next().await? {\n    // map the row into a user-defined domain type\n    let email: \u0026str = row.try_get(\"email\")?;\n}\n```\n\nTo assist with mapping the row into a domain type, there are two idioms that may be used:\n\n```rust\nlet mut stream = query(\"SELECT * FROM users\")\n    .map(|row: PgRow| {\n        // map the row into a user-defined domain type\n    })\n    .fetch(\u0026mut conn);\n```\n\n```rust\n#[derive(sqlx_oldapi::FromRow)]\nstruct User { name: String, id: i64 }\n\nlet mut stream = query_as::\u003c_, User\u003e(\"SELECT * FROM users WHERE email = ? OR name = ?\")\n    .bind(user_email)\n    .bind(user_name)\n    .fetch(\u0026mut conn);\n```\n\nInstead of a stream of results, we can use `fetch_one` or `fetch_optional` to request one required or optional result\nfrom the database.\n\n### ODBC Setup\n\nODBC support requires the `odbc` feature and an ODBC driver manager with appropriate drivers installed.\n\n#### Linux Setup\n\n1. Install unixODBC and ODBC drivers:\n\n```bash\n# Ubuntu/Debian\nsudo apt-get update\nsudo apt-get install -y unixodbc odbcinst unixodbc-common libodbcinst2\n\n# Install database-specific drivers\nsudo apt-get install -y odbc-postgresql  # For PostgreSQL\nsudo apt-get install -y libsqliteodbc    # For SQLite\n```\nODBC drivers are available for most popular databases:\n - Oracle: https://www.oracle.com/uk/database/technologies/releasenote-odbc-ic.html\n - Slowflake: https://docs.snowflake.com/en/developer-guide/odbc/odbc\n - BigQuery: https://cloud.google.com/bigquery/docs/reference/odbc-jdbc-drivers\n - DB2: https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information\n\n2. Configure your ODBC connection using a DSN (Data Source Name):\n\n```ini\n# ~/.odbc.ini\n[MyDatabase]\nDescription=SnowflakeDB for SQLx Testing\nDriver=SnowflakeDSIIDriver\nLocale=en-US\nSERVER=abcxyz-hh12345.snowflakecomputing.com\nDatabase=testdb\nPORT=443\nSSL=on\nACCOUNT=abcxyz-hh12345\nuid=test\npwd=ab_XY.1234567=-\nschema=public\n```\n\n3. Test your connection:\n\n```bash\necho \"SELECT 1;\" | isql -v MyDatabase\n```\n\n#### Windows Setup\n\n1. Install ODBC drivers for your database (usually included with database client software)\n2. Configure DSN through ODBC Data Source Administrator\n3. Use the DSN name in your connection string\n\n#### Connection Examples\n\n```rust\nuse sqlx_oldapi::odbc::OdbcPoolOptions;\n\n// Using DSN\nlet pool = OdbcPoolOptions::new()\n    .max_connections(5)\n    .connect(\"DSN=MyDatabase\").await?;\n\n// Using connection string\nlet pool = OdbcPoolOptions::new()\n    .max_connections(5)\n    .connect(\"Driver={PostgreSQL Unicode};Server=localhost;Port=5432;Database=mydb;UID=myuser;PWD=mypassword\").await?;\n\n// Using Any driver (automatically detects ODBC)\nuse sqlx_oldapi::any::AnyPoolOptions;\nlet pool = AnyPoolOptions::new()\n    .max_connections(5)\n    .connect(\"DSN=MyDatabase\").await?;\n```\n\n### Compile-time verification\n\nWe can use the macro, `sqlx_oldapi::query!` to achieve compile-time syntactic and semantic verification of the SQL, with\nan output to an anonymous record type where each SQL column is a Rust field (using raw identifiers where needed).\n\n```rust\nlet countries = query!(\n        \"\nSELECT country, COUNT(*) as count\nFROM users\nGROUP BY country\nWHERE organization = ?\n        \",\n        organization\n    )\n    .fetch_all(\u0026pool) // -\u003e Vec\u003c{ country: String, count: i64 }\u003e\n    .await?;\n\n// countries[0].country\n// countries[0].count\n```\n\nDifferences from `query()`:\n\n-   The input (or bind) parameters must be given all at once (and they are compile-time validated to be\n    the right number and the right type).\n\n-   The output type is an anonymous record. In the above example the type would be similar to:\n\n    ```rust\n    { country: String, count: i64 }\n    ```\n\n-   The `DATABASE_URL` environment variable must be set at build time to a database which it can prepare\n    queries against; the database does not have to contain any data but must be the same\n    kind (MySQL, Postgres, etc.) and have the same schema as the database you will be connecting to at runtime.\n\n    For convenience, you can use [a `.env` file][dotenv]\u003csup\u003e1\u003c/sup\u003e to set DATABASE_URL so that you don't have to pass it every time:\n\n    ```\n    DATABASE_URL=mysql://localhost/my_database\n    ```\n\n[dotenv]: https://github.com/dotenv-rs/dotenv#examples\n\nThe biggest downside to `query!()` is that the output type cannot be named (due to Rust not\nofficially supporting anonymous records). To address that, there is a `query_as!()` macro that is \nmostly identical except that you can name the output type.\n\n```rust\n// no traits are needed\nstruct Country { country: String, count: i64 }\n\nlet countries = query_as!(Country,\n        \"\nSELECT country, COUNT(*) as count\nFROM users\nGROUP BY country\nWHERE organization = ?\n        \",\n        organization\n    )\n    .fetch_all(\u0026pool) // -\u003e Vec\u003cCountry\u003e\n    .await?;\n\n// countries[0].country\n// countries[0].count\n```\n\nTo avoid the need of having a development database around to compile the project even when no\nmodifications (to the database-accessing parts of the code) are done, you can enable \"offline mode\"\nto cache the results of the SQL query analysis using the `sqlx` command-line tool. See\n[sqlx-cli/README.md](./sqlx-cli/README.md#enable-building-in-offline-mode-with-query).\n\nCompile time verified queries do quite a bit of work at compile time. Incremental actions like\n`cargo check` and `cargo build` can be significantly faster when using an optimized build by\nputting the following in your `Cargo.toml` (More information in the\n[Profiles section](https://doc.rust-lang.org/cargo/reference/profiles.html) of The Cargo Book)\n\n```toml\n[profile.dev.package.sqlx-macros]\nopt-level = 3\n```\n\n\u003csup\u003e1\u003c/sup\u003e The `dotenv` crate itself appears abandoned as of [December 2021](https://github.com/dotenv-rs/dotenv/issues/74)\nso we now use the `dotenvy` crate instead. The file format is the same.\n\n## Safety\n\nThis crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% Safe Rust.\n\nIf the `sqlite` feature is enabled, this is downgraded to `#![deny(unsafe_code)]` with `#![allow(unsafe_code)]` on the\n`sqlx::sqlite` module. There are several places where we interact with the C SQLite API. We try to document each call for the invariants we're assuming. We absolutely welcome auditing of, and feedback on, our unsafe code usage.\n\n## License\n\nLicensed under either of\n\n-   Apache License, Version 2.0\n    ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n-   MIT license\n    ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlpage%2Fsqlx-oldapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlpage%2Fsqlx-oldapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlpage%2Fsqlx-oldapi/lists"}