postgresql

This forum is meant for questions and discussions about the X# language and tools
Juraj
Posts: 161
Joined: Mon Jan 09, 2017 7:00 am

postgresql

Post by Juraj »

Hi All,does anyone have experience with postgres and dapper?Juraj
FFF
Posts: 1571
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

postgresql

Post by FFF »

Hi Juraj,
for PG ask Johan Nel, i think he uses it from the beginning... IIRC, Wolfgang R. also has it in production for some time.
As for dapper, AFAIK, nobody has spoken here about it, sorry.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

postgresql

Post by wriedmann »

Hi Juraj,
as Karl said: I'm using it in production, from VO (through a self written COM wrapper), X# and PHP (we have some larger projects on it).
But for Dapper: I had to google it to understand what it is.
I prefer to have less possible dependences in my code, and I have written my own (thin) libraries that expose the same functionality for PG, MS SQL, MySQL, SQLite and Oracle.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Juraj
Posts: 161
Joined: Mon Jan 09, 2017 7:00 am

postgresql

Post by Juraj »

Hi Wolfgang,Thank you for your response. I need to start a project quickly with Postgresql database in local network (3-4 clients), so it would be very helpful for me to use some validated existing libraries to save time. I will be grateful for any help.Juraj
FFF
Posts: 1571
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

postgresql

Post by FFF »

Jurai,
you are aware of npgsql.org? This should let you work with pg from x# like any DBMS via ado.net.
@all: sorry for strange appeareance, can't hinder forum software from interfering with my text
Attachments
forum.PNG
forum.PNG (22.82 KiB) Viewed 716 times
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

postgresql

Post by wriedmann »

Hi Juraj,
please give me a bit of time, and then I will publish my class library.
Basically I'm having a class called PGConnection with methods like :GetDataTable( cSelect ) and :ExecuteStatement( cStmt ) that does all the work. And there are helper classes to build insert and update statements.
All these classes I have are working the same manner for all the different SQL engines I need to use (the most used are MS SQL, PostgreSQL, SQLite and Oracle).
The beauty of .NET is that you don't need any configuration on the client machines, and therefore I have build COM libraries for my VO applications that do exactly that.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

postgresql

Post by wriedmann »

Hi Juraj,
this is my code to get a .NET DataTable from a PostgreSQL database:

method GetDataTable( cSelect as string ) as DataTable
    local oAdapter            as NpgsqlDataAdapter
    local oDataSet            as DataSet
    local oDataTable        as DataTable

    oDataTable          := null_object

    try

    oAdapter            := NpgsqlDataAdapter{ cSelect, self:Connection }
    oDataSet            := Dataset{}
    oAdapter:Fill( oDataSet )
    oDataTable          := oDataSet:Tables[0]
    oDataSet            := null_object

    catch oEx as Exception

    _cLastError            := oEx:Message
    rdm.BaseLib.ErrorSys.InvokeExceptionHandler( oEx, cSelect )
    rdm.BaseLib.ErrorSys.ProcessException( oEx )

    end try

    return oDataTable

Wolfgang
 
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
rjpajaron
Posts: 364
Joined: Fri Nov 06, 2015 12:01 am

postgresql

Post by rjpajaron »

We are using this. You can use the free Npgsql. But we used the paid Devart dotConnect for PostgreSQL.
FFF
Posts: 1571
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

postgresql

Post by FFF »

rjpajaron wrote:...But we used the paid Devart dotConnect for PostgreSQL.
Why? Just curious...
 
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
rjpajaron
Posts: 364
Joined: Fri Nov 06, 2015 12:01 am

postgresql

Post by rjpajaron »

It is more powerful and feature loaded. Key features that we use syncing data that Npgsql does not have.
Post Reply