huwwynnjones / oci_rs Goto Github PK
View Code? Open in Web Editor NEWA Rust wrapper to the Oracle Call Interface (OCI) library.
License: MIT License
A Rust wrapper to the Oracle Call Interface (OCI) library.
License: MIT License
Currently, you are using empty enums to represent the OCI opaque handle structs, such as Env. According to official Rust documentation, this is a bad idea.
From the Rust nomicon:
"Notice that it is a really bad idea to use an empty enum as FFI type. The compiler relies on empty enums being uninhabited, so handling values of type &Empty is a huge footgun and can lead to buggy program behavior (by triggering undefined behavior)."
See here: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs
When trying to compile a simple application (the hello world stub) with oci_rs = "0.3.1" I am getting the following error:
Compiling oci_rs v0.3.1
error[E0283]: type annotations required: cannot resolve `std::string::String: std::convert::From<&_>`
--> /Users/dima/.cargo/registry/src/github.com-1ecc6299db9ec823/oci_rs-0.3.1/src/types.rs:123:17
|
123 | let s = String::from(self.as_ref());
| ^^^^^^^^^^^^
|
= note: required by `std::convert::From::from`
Program compiles if I comment out the implementation of ToSqlValue
for String
:
impl ToSqlValue for String {
fn to_sql_value(&self) -> SqlValue {
let s = String::from(self.as_ref());
SqlValue::VarChar(s)
}
}
when oci environment is not ready.
program will fail in loop in oci_error.rs:110.
and never break the loop.
If the database has the local set up with 12 hour clock then date fields are not accepted correctly.
This is because date strings are used to create oracle dates. This is subject to changes in the format accepted by the database.
Better solution is to create dates in their binary format instead. On the to-do list.
Hello !
In oci_errors
, fn get_error
the loop can be infinite when error occurs while trying to get the db error.
I think in match, it should break the loop for ReturnCode::Error
and ReturnCode::InvalidHandle
cases...
In my platform (fedora) it loops infinitly
Hello everyone, I can't solve this.
[dependencies]
oci_rs = "0.8.0"
rustc 1.40.0 (73528e339 2019-12-16)
Allow the SQL DATE type to be used
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.