PostgreSQL database operations

by NullQuery
Use a PostgreSQL database backend for your world
ID:1979685
 
Fork me on GitHub
This library allows you to connect and send queries to PostgreSQL databases. PostgreSQL is a popular alternative to MySQL/MariaDB primarily used in enterprise environments. It has a more strict syntax than MySQL/MariaDB and is my preferred database software, hence this library.

Both Windows and Linux are supported. Tested on Windows 10 Professional and CentOS 7 (64-bit multiarch)

Bug reports and suggestions may be reported to the appropriate forum.

The library is object-oriented and is very simple to use. See the demo code in the project.

Changelog:
Version 1.4
  • Added a 'dbtype' field to return the type of database.
Version 1.3*
  • Major release. The library is now attached to the sql4dm suite. Note that the changelog functionality now exists as a separate library.
Version 1.2*
  • Bug fix: Null values are now properly sent as SQL NULL's.
Version 1.1
  • Provides a link to the bug tracker when throwing exceptions.
  • Modified the example to show use of prepared statements.
  • Added a Changelog object. Point this at an XML file to automatically manage database updates. See sample_changelog.xml for an example.
Version 1.0*
  • Initial release.

Fields marked with an asterix (*) denote a modification of the DLL/SO files, which requires you to overwrite them with the ones in your project folder.
Brilliant, thanks.
In response to A.T.H.K
A.T.H.K wrote:
Brilliant, thanks.

Thanks!

If you find the library useful please add it to your list of favorites to show your support! Having raw numbers helps me to see who is interested in my work.
Would prefer if you also included the source for the dll you compiled, people don't always trust dll files without the source.
In response to Nadrew
Nadrew wrote:
Would prefer if you also included the source for the dll you compiled, people don't always trust dll files without the source.

This is going to sound very puerile, but at this time I prefer to keep C++ components closed-source as it seems very few in this community actually have the ability to write them, and it would put me in a more advantageous position were I not to divulge my methods of developing these libraries.

I understand that this makes you hesitant to use my work, but I believe it'll be a good way for me to build rapport and credibility within the BYOND community.

You can of course always examine the dependencies used by the DLL/SO and attach it to a debugger which will give you information on which Windows API calls it performs. This should convince you that it doesn't do anything harmful.

During the time I'm this close-minded I'll naturally prioritize any bug reports with my libraries that may crop up, which I hope you'll see as an advantage for this community.
I've released an update to the library. The changelog is listed in the original post / hub description.

The major addition is a changelog object which you can use to manage database updates. The concept is that you can host your game with a clean database and it'll automatically create the required tables and even sample data to get you started. This is done in XML format, and is based off the Java program Liquibase which works in a similar way.
Wrote my own Postgre, MSSQL, and MariaDB handlers back when I was working on Dantom.DB, even tried to talk Tom into letting me weave it into Dantom.DB as a one-stop-shop for database interfaces but it never really came to fruition.

I wonder if I still have the source for that floating around on my old laptop hard drive, could probably stand to be cleaned up and released.
In response to NullQuery
NullQuery wrote:
Nadrew wrote:
Would prefer if you also included the source for the dll you compiled, people don't always trust dll files without the source.

This is going to sound very puerile, but at this time I prefer to keep C++ components closed-source as it seems very few in this community actually have the ability to write them, and it would put me in a more advantageous position were I not to divulge my methods of developing these libraries.

I understand that this makes you hesitant to use my work, but I believe it'll be a good way for me to build rapport and credibility within the BYOND community.

You can of course always examine the dependencies used by the DLL/SO and attach it to a debugger which will give you information on which Windows API calls it performs. This should convince you that it doesn't do anything harmful.

During the time I'm this close-minded I'll naturally prioritize any bug reports with my libraries that may crop up, which I hope you'll see as an advantage for this community.

That's a terrible reason and it'll just lower your credibility in my eyes.
Not divulging your methods to writing these libraries-- that just seems silly, especially when people can help you
---
Regardless, for the unsure, I've dug into it and the latest version(as of 11-18-2015) is safe, if not suffering from a bloated binary and some inefficiencies.
Can't see this library being very popular without source for me to inspect.