Yet More Blobs (PostgreSQL)

BlitzMax Forums/Brucey's Modules/Yet More Blobs (PostgreSQL)

Brucey(Posted 2009) [#1]
I've now added Blob support for BaH.DBPostgreSQL.

I also noticed an issue with retrieving doubles/floats from the database, which I've also fixed.

Adding Blob support required a bit of hacking around of the core functions, so I hope I've not broken anything important.

David, have you got any regression tests you can run? :-)


DavidDC(Posted 2009) [#2]
Passes all tests with flying colours thanks Brucey :-) No wobbles, no leaks. Mind you I haven't tested the Blob code specifically - I just built against my existing code.


Space_guy(Posted 2009) [#3]
Thats great news! Will the blob support come to the other databases too? Im just wondering if I should change from sqlite to postgresql.


Space_guy(Posted 2009) [#4]
Well. Now im having problems again. It tells me type "blob" does not exist when i create a table with blobs in postgre. Worked fine for me in sqlite. something I should change here?


Space_guy(Posted 2009) [#5]
Also it tells me the same thing on "datetime". I guess I should use something else there. Perhaps "Date" or "Time"
I never thought changing database engine was so much work :( hehe ;)


Brucey(Posted 2009) [#6]
It tells me type "blob" does not exist when i create a table with blobs in postgres

Ah, well... you see the problem is not with my drivers, but rather with database-specific table creation code.
It's something that affects all databases - where they each do something a bit differently.
Most SELECT, UPDATE, INSERT, etc SQL is usually much more standardised between databases.

For Blobs, you can define a column as "bytea".

As for the date, time stuff... I appear not to have implemented it yet.... so many databases so little time :-p
Let me check the API and see what needs done here.


Space_guy(Posted 2009) [#7]
Thanks alot :)


Brucey(Posted 2009) [#8]
Ok, I've committed initial support for date/time, with a couple of test apps.

Test one is a basic, insert stuff, retrieve the data.
Test two inserts, but uses binding in the SELECT to retrieve the data. It also shows how you can get the DB "type" object from the record - just in case you want a non-string representation of the date/time.

The tests run fine here. May need some more thrashing though.

Please let me know if you have any issues with it.


Space_guy(Posted 2009) [#9]
Thanks i will try it out later today(time permitting)