Giter VIP home page Giter VIP logo

firebird's People

Contributors

skrylar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

peter2121

firebird's Issues

Investigate passing Nim strings directly

Firebird, as part of its support for Delphi inherited from Interbase most likely, allows Pascal strings. We should see if it is safe to hand Nim strings along using this interface, and avoid any copying created from the use of cstrings.

Examples for basic usage

Example code to show how to use the library, which also need to be integrated with the docs. Lastly the examples allow us to see any pain points that could use some extra help (via templates) to make things easier.

Where is ibase.h most reliably found?

Under Arch, with Firebird 2.5, it is found in /usr/include. According to #1 it is not always found there, and I am uncertain if there is a pkg-config file we can use to find it.

Remove ISC prefix from most things

Since Nim has named imports, you can just import firebird3 as isc if you want isc.dosomething everywhere. The ISC prefix should then be removed from type names, procs, and the documentation.

Migrate docs to adoc?

Tempted to say no on this one, because I don't really want to port all the docs over.
Texinfo

  • Multiple indices (function index, concept index.)
  • Includes the index with outputs by default.
  • Can paginate without a Docbook/XSLT stack.
  • Has rather ugly output; have to dig around with command line and template files to get a custom theme going.
  • Everyone seems to hate writing it (didn't find it too troubling)

Asciidoc[tor.rb]

  • Has pretty output by default
  • But doesn't support multiple indexes (ex. no function index.)
  • Requires a docbook/xslt stack to paginate.
  • Requires the docbook/xslt stack to generate the ONE INDEX that it supports but won't actually do by itself.

Note to initial commit

Great effort to wrap the fbclient

Tried to compile with nim c ex01.nim on linux.
ibase.h was not picked up initially but was ok when I gave it the full path
#{.passl: "-lfbembed".} failed , after commenting out I get this:

/data5/NimTests/firebird/examples/nimcache/ex01.o: In function `NimMainModule':
ex01.c:(.text+0x168): undefined reference to `isc_dsql_execute_immediate'
ex01.c:(.text+0x18e): undefined reference to `isc_commit_transaction'
ex01.c:(.text+0x19d): undefined reference to `isc_detach_database'
collect2: error: ld returned 1 exit status

In firebird3 there is no libfbembed.so , I think embedded connections are via libEngine12.so
which is set in the configuration files.

In case you continue this effort it might be best to connect with the firebird developers
at https://www.firebirdsql.org via their developers mailing-list.

I am sure they are able and happy to answer any current and upcoming questions.

Maybe some of these manuals will help too: https://www.firebirdsql.org/en/reference-manuals/

My current solution https://github.com/qqtop/NimFirebird is via the python driver , but in the long run a "pure" nim driver is the way to go.

The firebird community is actually quite large and active in Brasil,Russia,Germany and Czech.

Embedded mode under 3.0?

Under 2.5, there is fbembed. Under 3.0, that doesn't exist. Installing the dev, common and client packages under Deb/Sid results in non-working examples (they "cannot connect to localhost.")

Trying to find docs to force embedded mode (if possible,) although its proving difficult.

Exception handling?

Should the wrapper check return codes from functions, and convert those in to exceptions?

A secondary question: should exceptions be generic, shallow tiered, or complex? Generic errors are the easiest and if using exceptions I would probably go this route. That would mean just checking that status is not zero, asking firebird to describe it (they have an example for this) and boxing that up in a simple exception that gets thrown. I'm not aware of a case where status codes represent some kind of "caution but not fatal" scenario.

A tiered approach fits Nim more closely, but starts requiring diving in to the error code header (it's quite huge) and trying to map those error codes to some sensible categories of error. That might be an interesting "future" work that would be backward compatible to the shallow errors.

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.