Giter Club home page Giter Club logo

oci_rs's People

Contributors

huwwynnjones avatar rkarp avatar tatref avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

oci_rs's Issues

Use opaque structs over empty enums in FFI

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

Compilation failure with oci_rs 0.3.1 - type annotations required

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)
    }
}

loop in oci_error.rs:110

when oci environment is not ready.
program will fail in loop in oci_error.rs:110.
and never break the loop.

Dates not working when db is not set to 24hr clock

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.

oci_error -> infinite loop

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.