| BaH.DBPostgreSQL: | Modinfo | Source |
The DBPostgreSQL database driver allows you to connect to PostgreSQL databases through the standard API provided by the Database Framework module.
You will need the PostgreSQL (libpq) client libraries installed. You can download these from the PostgreSQL website.
The DBPostgreSQL module has been developed and tested using the latest version 8 PostgreSQL database and libraries. It is suggested that this is the version you use, as previous versions may not have all the functionality required for this driver.
On Windows, a libpq.a file has been provided (in the lib folder) for compilation. This should be copied into the BlitzMax/lib folder.
Linux users should install the PostgreSQL "dev" packages to enable correct linking of the applications to take place.
For MacOS, a pre-compiled package can be downloaded from here.
Note : To link to the OS X shared objects (.dylib) requires a tweak to bmk. Until the new version is released officially, see the Module Tweaks section of the Blitz forums for details of what to change.
To enable a PostgreSQL connection, you simply pass a dbtype of "POSTGRESQL" to the LoadDatabase function.
The dbname parameter refers to the name of the database you wish to connect to.
The host and port parameters are optional if you are connecting to a local PostgreSQL server.
user and password should be filled in as required.
PostgreSQL placeholders are defined by the form $n. Where n is a number starting at 1. (for example, $1, would be the first parameter).
Remember that the Database Framework bindings start at 0, rather than 1, so in the code, binding to 0 would actual bind to the placeholder $1.
For a complete guide to the PostgreSQL syntax, you can browse the excellent online documentation here.
| Version | 1.03 |
|---|---|
| Author | Bruce A Henderson |
| License | BSD |
| Copyright | Bruce A Henderson |
| Modserver | BRL |
| History | 1.03 |
| History | Fixed issue with mis-count of bound parameters. |
| History | 1.02 |
| History | Added hasPrepareSupport() and hasTransactionSupport() methods. |
| History | 1.01 |
| History | Fixed open() not closing if already open. |
| History | 1.00 Initial Release |