comp.lang.ada
 help / color / mirror / Atom feed
From: George J <ivanov_george@list.ru>
Subject: Re: gnatcoll_db2ada problem "Database not supported:"
Date: Fri, 27 Dec 2019 07:39:21 -0800 (PST)
Date: 2019-12-27T07:39:21-08:00	[thread overview]
Message-ID: <ec108e7a-3c37-4c4d-9800-e0f8e24f6170@googlegroups.com> (raw)
In-Reply-To: <qu4ppr$k35$1@gioia.aioe.org>

пятница, 27 декабря 2019 г., 14:26:55 UTC+3 пользователь Dmitry A. Kazakov написал:
> On 2019-12-27 11:48, George J wrote:
> 
> > And my question is. What if i already have some big database and want to create an Ada app to work with.
> 
> That is 80% of the cases.
> 
> > Can i work with it in the same way?
> 
> You can work in a normal way, i.e. create environment (if required), 
> open connection, prepare statement, bind parameters, execute statement, 
> fetch results. It is no rocket science.
> 
> > May be i don't know something. Or i can work with db file with connecting to him and send direct SQL queries?
> 
> That is the way to do it.
> 
> > I've never worked with databases with Ada so this theme is very difficult for me now. But interesting)
> 
> Ada does not differ in working with DB to any other language.
> 
> I understand that you are stuck with some higher-level DB client 
> abstraction. I would tentatively suggest to use a more direct method.
> 
> In my view if abstraction is needed, then it must be higher, e.g. a 
> persistency layer abstracting all DB and whole SQL mess away. Otherwise, 
> it only complicates the ugly stuff, IMO.
> 
> P.S. Talking about big databases, SQLite3 is absolutely unsuitable for 
> dealing with a big database. It is not an intended use case of.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Thanks, Dmitry!
Yes, you're right, i've lost in abstractions and couldn't understand how to work with .db file with gnatcoll_db2ada.
I wanted also to try this example - https://www.adacore.com/gems/gem-129-type-safe-database-api-part-1/, but i have the error described below.
And database not so big, it's about 8-10 tables contains not much data. So i've decided to use sqlite.
And i couldn't find any simple example of using gnatcoll-db or any other module with database, like
1. open db - "Some_Open_Proc ("test.db");"
2. get some values - "SQL_Query_Proc ( "GET * FROM .....", ... );"
3. close conneсtion - "Some_Close_Proc ( ... );"
Now i've found some examples using ADO and AdaBase modules, so i will study them.
Thanks!


      reply	other threads:[~2019-12-27 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27 10:48 gnatcoll_db2ada problem "Database not supported:" George J
2019-12-27 11:26 ` Dmitry A. Kazakov
2019-12-27 15:39   ` George J [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox