xsharp.eu • postgresql
Page 1 of 2

postgresql

Posted: Wed Jan 13, 2021 5:01 pm
by Juraj
Hi All,does anyone have experience with postgres and dapper?Juraj

postgresql

Posted: Wed Jan 13, 2021 8:19 pm
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.

postgresql

Posted: Thu Jan 14, 2021 4:51 am
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

postgresql

Posted: Thu Jan 14, 2021 8:32 am
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

postgresql

Posted: Thu Jan 14, 2021 8:36 am
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

postgresql

Posted: Thu Jan 14, 2021 8:37 am
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

postgresql

Posted: Thu Jan 14, 2021 8:41 am
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
 

postgresql

Posted: Thu Jan 14, 2021 10:26 am
by rjpajaron
We are using this. You can use the free Npgsql. But we used the paid Devart dotConnect for PostgreSQL.

postgresql

Posted: Thu Jan 14, 2021 10:36 am
by FFF
rjpajaron wrote:...But we used the paid Devart dotConnect for PostgreSQL.
Why? Just curious...
 

postgresql

Posted: Thu Jan 14, 2021 11:12 am
by rjpajaron
It is more powerful and feature loaded. Key features that we use syncing data that Npgsql does not have.