{"id":13636972,"url":"https://github.com/kubo/rust-oracle","last_synced_at":"2026-04-09T03:30:54.250Z","repository":{"id":17308889,"uuid":"81656167","full_name":"kubo/rust-oracle","owner":"kubo","description":"Oracle driver for Rust","archived":false,"fork":false,"pushed_at":"2025-03-23T02:08:27.000Z","size":9784,"stargazers_count":217,"open_issues_count":22,"forks_count":46,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-01-02T10:57:07.337Z","etag":null,"topics":["oracle","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubo.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-11T13:55:33.000Z","updated_at":"2025-12-24T08:41:40.000Z","dependencies_parsed_at":"2024-10-28T15:43:51.782Z","dependency_job_id":"9e8ce19b-5ee2-4d5f-9cb3-10c9ba0d44bc","html_url":"https://github.com/kubo/rust-oracle","commit_stats":{"total_commits":378,"total_committers":10,"mean_commits":37.8,"dds":"0.031746031746031744","last_synced_commit":"df78a3a64789490e3da0d9dbdb1cd261b4960b04"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/kubo/rust-oracle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubo%2Frust-oracle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubo%2Frust-oracle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubo%2Frust-oracle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubo%2Frust-oracle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubo","download_url":"https://codeload.github.com/kubo/rust-oracle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubo%2Frust-oracle/sbom","scorecard":{"id":572836,"data":{"date":"2025-08-11","repo":{"name":"github.com/kubo/rust-oracle","commit":"caf3c0d06b654e79192e88bbaf516e599982af05"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/28 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/gh-pages.yml:1","Warn: no topLevel permission defined: .github/workflows/run-tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/kubo/rust-oracle/gh-pages.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kubo/rust-oracle/gh-pages.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/kubo/rust-oracle/run-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/kubo/rust-oracle/run-tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/run-tests.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/kubo/rust-oracle/run-tests.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T16:48:13.910Z","repository_id":17308889,"created_at":"2025-08-20T16:48:13.910Z","updated_at":"2025-08-20T16:48:13.910Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["oracle","rust"],"created_at":"2024-08-02T00:01:08.599Z","updated_at":"2026-04-09T03:30:54.234Z","avatar_url":"https://github.com/kubo.png","language":"Rust","readme":"# Rust-oracle\n[![Test](https://img.shields.io/github/actions/workflow/status/kubo/rust-oracle/run-tests.yml?branch=master)](https://github.com/kubo/rust-oracle/actions/workflows/run-tests.yml)\n[![Crates.io](https://img.shields.io/crates/v/oracle.svg)](https://crates.io/crates/oracle)\n[![Docs](https://docs.rs/oracle/badge.svg)](https://docs.rs/oracle)\n[![Docs (in development)](https://img.shields.io/badge/docs-in_development-486D9F)](https://www.jiubao.org/rust-oracle/oracle/)\n\nThis is an [Oracle database][] driver for [Rust][] based on [ODPI-C][].\n\n## Change Log\n\nSee [ChangeLog.md](https://github.com/kubo/rust-oracle/blob/master/ChangeLog.md).\n\n## Compile-time Requirements\n\n* C compiler. See [`Compile-time Requirements`](https://docs.rs/cc/latest/cc/#compile-time-requirements).\n\n## Run-time Requirements\n\n* Oracle client 11.2 or later. See [ODPI-C installation document][].\n\n## Supported Rust Versions\n\nThe oracle crate supports **at least** 6 rust minor versions including the stable\nrelease at the time when the crate was released. The MSRV (minimum supported\nrust version) may be changed when a patch version is incremented though it will\nnot be changed frequently. The current MSRV is 1.68.0.\n\noracle crate version | MSRV\n---|---\n0.7.0 ~ | 1.68.0\n0.6.0 ~ 0.6.3 | 1.60.0\n0.5.5 ~ 0.5.7 | 1.54.0\n\n## Usage\n\nPut this in your `Cargo.toml`:\n\n```text\n[dependencies]\noracle = \"0.6.3\"\n```\n## Optional Features\n\nThe following features can be enabled from Cargo.toml:\n\nFeature\t| Description | available version\n---|---|---\n`chrono` | Implements [`ToSql`] and [`FromSql`] for [chrono] data types. | any\n`stmt_without_lifetime` | Removes `conn` lifetime from [`Statement`]. This is available to avoid lifetime conflicts. | 0.5.7\u0026nbsp;only\n`aq_unstable` | Enables [Oracle Advanced Queuing support][aq]. This is unstable. It may be changed incompatibly by minor version upgrades. | since\u0026nbsp;0.5.5\n\n## Examples\n\nExecutes select statements and get rows:\n\n```rust,no_run\nuse oracle::{Connection, Error};\n\n// Connect to a database.\nlet conn = Connection::connect(\"scott\", \"tiger\", \"//localhost/XE\")?;\n\nlet sql = \"select ename, sal, comm from emp where deptno = :1\";\n\n// Select a table with a bind variable.\nprintln!(\"---------------|---------------|---------------|\");\nlet rows = conn.query(sql, \u0026[\u002630])?;\nfor row_result in rows {\n    let row = row_result?;\n    // get a column value by position (0-based)\n    let ename: String = row.get(0)?;\n    // get a column by name (case-insensitive)\n    let sal: i32 = row.get(\"sal\")?;\n    // Use `Option\u003c...\u003e` to get a nullable column.\n    // Otherwise, `Err(Error::NullValue)` is returned\n    // for null values.\n    let comm: Option\u003ci32\u003e = row.get(2)?;\n\n    println!(\" {:14}| {:\u003e10}    | {:\u003e10}    |\",\n             ename,\n             sal,\n             comm.map_or(\"\".to_string(), |v| v.to_string()));\n}\n\n// Another way to fetch rows.\n// The rows iterator returns Result\u003c(String, i32, Option\u003ci32\u003e)\u003e.\nprintln!(\"---------------|---------------|---------------|\");\nlet rows = conn.query_as::\u003c(String, i32, Option\u003ci32\u003e)\u003e(sql, \u0026[\u002610])?;\nfor row_result in rows {\n    let (ename, sal, comm) = row_result?;\n    println!(\" {:14}| {:\u003e10}    | {:\u003e10}    |\",\n             ename,\n             sal,\n             comm.map_or(\"\".to_string(), |v| v.to_string()));\n}\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nExecutes select statements and get the first rows:\n\n```rust,no_run\nuse oracle::Connection;\n\n// Connect to a database.\nlet conn = Connection::connect(\"scott\", \"tiger\", \"//localhost/XE\")?;\n\nlet sql = \"select ename, sal, comm from emp where empno = :1\";\n\n// Print the first row.\nlet row = conn.query_row(sql, \u0026[\u00267369])?;\nlet ename: String = row.get(\"empno\")?;\nlet sal: i32 = row.get(\"sal\")?;\nlet comm: Option\u003ci32\u003e = row.get(\"comm\")?;\nprintln!(\"---------------|---------------|---------------|\");\nprintln!(\" {:14}| {:\u003e10}    | {:\u003e10}    |\",\n         ename,\n         sal,\n         comm.map_or(\"\".to_string(), |v| v.to_string()));\n// When no rows are found, conn.query_row() returns `Err(Error::NoDataFound)`.\n\n// Get the first row as a tupple\nlet row = conn.query_row_as::\u003c(String, i32, Option\u003ci32\u003e)\u003e(sql, \u0026[\u00267566])?;\nprintln!(\"---------------|---------------|---------------|\");\nprintln!(\" {:14}| {:\u003e10}    | {:\u003e10}    |\",\n         row.0,\n         row.1,\n         row.2.map_or(\"\".to_string(), |v| v.to_string()));\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nExecutes non-select statements:\n\n```rust,no_run\nuse oracle::Connection;\n\n// Connect to a database.\nlet conn = Connection::connect(\"scott\", \"tiger\", \"//localhost/XE\")?;\n\nconn.execute(\"create table person (id number(38), name varchar2(40))\", \u0026[])?;\n\n// Execute a statement with positional parameters.\nconn.execute(\"insert into person values (:1, :2)\",\n             \u0026[\u00261, // first parameter\n               \u0026\"John\" // second parameter\n              ])?;\n\n// Execute a statement with named parameters.\nconn.execute_named(\"insert into person values (:id, :name)\",\n                   \u0026[(\"id\", \u00262), // 'id' parameter\n                     (\"name\", \u0026\"Smith\"), // 'name' parameter\n                    ])?;\n\n// Commit the transaction.\nconn.commit()?;\n\n// Delete rows\nconn.execute(\"delete from person\", \u0026[])?;\n\n// Rollback the transaction.\nconn.rollback()?;\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nPrints column information:\n\n```rust,no_run\nuse oracle::Connection;\n\n// Connect to a database.\nlet conn = Connection::connect(\"scott\", \"tiger\", \"//localhost/XE\")?;\n\nlet sql = \"select ename, sal, comm from emp where 1 = 2\";\nlet rows = conn.query(sql, \u0026[])?;\n\n// Print column names\nfor info in rows.column_info() {\n    print!(\" {:14}|\", info.name());\n}\nprintln!(\"\");\n\n// Print column types\nfor info in rows.column_info() {\n    print!(\" {:14}|\", info.oracle_type().to_string());\n}\nprintln!(\"\");\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nPrepared statement:\n\n```rust,no_run\nuse oracle::Connection;\n\nlet conn = Connection::connect(\"scott\", \"tiger\", \"//localhost/XE\")?;\n\n// Create a prepared statement\nlet mut stmt = conn.statement(\"insert into person values (:1, :2)\").build()?;\n// Insert one row\nstmt.execute(\u0026[\u00261, \u0026\"John\"])?;\n// Insert another row\nstmt.execute(\u0026[\u00262, \u0026\"Smith\"])?;\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nThis is more efficient than two `conn.execute()`.\nAn SQL statement is executed in the DBMS as follows:\n\n* step 1. Parse the SQL statement and create an execution plan.\n* step 2. Execute the plan with bind parameters.\n\nWhen a prepared statement is used, step 1 is called only once.\n\n## NLS_LANG parameter\n\n[NLS_LANG][] consists of three components: language, territory and\ncharset. However the charset component is ignored and UTF-8(AL32UTF8) is used\nas charset because rust characters are UTF-8.\n\nThe territory component specifies numeric format, date format and so on.\nHowever it affects only conversion in Oracle. See the following example:\n\n```rust,no_run\nuse oracle::Connection;\n\n// The territory is France.\nstd::env::set_var(\"NLS_LANG\", \"french_france.AL32UTF8\");\nlet conn = Connection::connect(\"scott\", \"tiger\", \"\")?;\n\n// 10.1 is converted to a string in Oracle and fetched as a string.\nlet result = conn.query_row_as::\u003cString\u003e(\"select to_char(10.1) from dual\", \u0026[])?;\nassert_eq!(result, \"10,1\"); // The decimal mark depends on the territory.\n\n// 10.1 is fetched as a number and converted to a string in rust-oracle\nlet result = conn.query_row_as::\u003cString\u003e(\"select 10.1 from dual\", \u0026[])?;\nassert_eq!(result, \"10.1\"); // The decimal mark is always period(.).\n\n# Ok::\u003c(), oracle::Error\u003e(())\n```\n\nNote that NLS_LANG must be set before first rust-oracle function execution if\nrequired.\n\n## TODO\n\n* [BFILEs (External LOBs)](https://www.oracle.com/pls/topic/lookup?ctx=dblatest\u0026id=GUID-5834BC49-4053-40FF-BE39-B14342B1201E) (Note: Reading contents of BFILEs as `Vec\u003cu8\u003e` is supported.)\n* Scrollable cursors\n* Better Oracle object type support\n* XML data type\n* [JSON data type](https://oracle-base.com/articles/21c/json-data-type-21c)\n\n## Related Projects\n\nOther crates for connecting to Oracle:\n* [Sibyl]: an OCI-based interface supporting both blocking (threads) and nonblocking (async) API\n\nOracle-related crates:\n* [bb8-oracle]: [bb8] connection pool support for oracle\n* [diesel-oci]: A Oracle SQL database backend implementation for [Diesel][diesel]\n* [include-oracle-sql]: an extension of [include-sql] using [Sibyl] for database access\n* [r2d2-oracle]: Oracle support for the [r2d2] connection pool\n\n## License\n\nRust-oracle is under the terms of:\n\n1. [the Universal Permissive License v 1.0 or at your option, any later version](http://oss.oracle.com/licenses/upl); and/or\n2. [the Apache License v 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\nSome of doc comments were copied from ODPI-C documentation verbatim.\nOracle and/or its affiliates hold the copyright of the parts.\n\n[Rust]: https://www.rust-lang.org/\n[ODPI-C]: https://oracle.github.io/odpi/\n[ODPI-C installation document]: https://oracle.github.io/odpi/doc/installation.html\n[Oracle database]: https://www.oracle.com/database/index.html\n[NLS_LANG]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest\u0026id=GUID-86A29834-AE29-4BA5-8A78-E19C168B690A\n[`FromSql`]: https://docs.rs/oracle/latest/oracle/sql_type/trait.FromSql.html\n[`Connection`]: https://docs.rs/oracle/latest/oracle/struct.Connection.html\n[`Statement`]: https://docs.rs/oracle/latest/oracle/struct.Statement.html\n[`ToSql`]: https://docs.rs/oracle/latest/oracle/sql_type/trait.ToSql.html\n[aq]: https://docs.rs/oracle/latest/oracle/aq/index.html\n[bb8]: https://crates.io/crates/bb8\n[bb8-oracle]: https://crates.io/crates/bb8-oracle\n[chrono]: https://docs.rs/chrono/0.4/chrono/\n[include-sql]: https://crates.io/crates/include-sql\n[include-oracle-sql]: https://crates.io/crates/include-oracle-sql\n[diesel]: https://diesel.rs/\n[diesel-oci]: https://github.com/GiGainfosystems/diesel-oci/\n[r2d2]: https://crates.io/crates/r2d2\n[r2d2-oracle]: https://crates.io/crates/r2d2-oracle\n[Sibyl]: https://crates.io/crates/sibyl\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubo%2Frust-oracle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubo%2Frust-oracle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubo%2Frust-oracle/lists"}