Ecere SDK/eC Forums
http://ecere.org/community/
Print view

Databases and ecere
http://ecere.org/community/viewtopic.php?f=9&t=100
Page 1 of 1
Author:  D.Bane [ Fri Aug 27, 2010 1:29 am ]
Post subject:  Databases and ecere

Hi.

Me again :)

Wanted to ask about the databases..
I read all on this link:
http://www.ecere.com/wiki/index.php?tit ... cess_(EDA)
Yes, the file that is shown there is "not found on server", but I already took a look at it in samples directory, just to say that there is a link and it's not working..

What I'm interested in is security of edb, as well as if you know is it good with large amounts of large data, as I'll need to have data from 1940's in it, and to access it as quickly as I can,but no one not explicitly allowed to be able to get them..?

Thank you.
D.Bane
Author:  jerome [ Fri Aug 27, 2010 12:12 pm ]
Post subject:  Re: Databases and ecere

Hi D. Bane,

Thanks for letting us know about the broken link.
Actually we don't update the wiki much lately, I prefer the forums for most purposes.
There seems to be an installation problem with the wiki right now so I can't edit that page, I'll have to look into that. I'm glad you found it in the samples.

As far as the security of EDB is concerned, it all depends what you mean by that.
The two supported drivers in EDA right now are EDB and SQLite. Both of them work with a local file, they are not network services. So the data itself is as secured as the file system where the file is located. EDB doesn't support any encryption by itself, but of course you could always encrypt the data before storing it in EDB. May I suggest OpenSSL as an encryption library, you can see in extras/ examples on using a secured Socket.

If you're worried about limiting access from a local application perspective, you can implement the security in your application and prevent the users to access the file system from outside the application.

EDB is both very fast and very light, being sort of a minimalistic relational database system.
Its reliability has proven to be generally good, however since it does not implement any kind of journaling, any unexpected interruption while it's doing a storing operation can potentially corrupt the database. Therefore frequent backup would be recommended.

The SQLite driver makes EDA runs of top of a proven database system used in tons of applications and will give you a bit more reliability than EDB. It will also let you run actual SQL queries, something EDB can't do. The drawbacks are SQLite databases might take up a bit more storage place, might not be as lightning fast as EDB for straightforward operations, and you need to include a few hundred KBs more of object code for the SQLite engine.

You can use any driver with EDA and things should work, but note there are some slight differences in the behavior of the 2 drivers at the moment. The main one has to do with the auto incrementing row IDs. And of course EDB doesn't support SQL queries.

Take a look at the samples in the samples directory, including EDATest and MedDB, those are some good examples. I don't think there is any sample specifically using SQLite yet. Unfortunately, there isn't much documentation available yet on EDA, so don't hesitate to post any questions regarding how to use it here. We'll try to build up a good source of info for it on the forums in the process.

Regards,

Jerome
Author:  D.Bane [ Sat Aug 28, 2010 12:45 pm ]
Post subject:  Re: Databases and ecere

Thank you jerome, as always, you give me high quality answers.

I'll try the OpenSSL than :), and for the security, it's from a local perspective, as I don't want someone easily listing tables and data in them (like in older - maybe new too - .mdb's).. So there is no some sort of a password that is sent to db?

I like the examples, so I look at them when I need something, wanted to look at eNotepad,but saw the "openrider", and stayed clicking for some time, :lol: Liked it :). Took a look at eNotepad too, it's like regular notepad as I saw, haven't seen the MDI in it?

Well since it's important not to loose anything, I think I'll be using SQLite as main db, and edb at it's side, and if it turns up as half as good as Ecere it will be the main one :)

Thank you for the answers, and just to say, if there is not any other way to help you, I'll at least ask questions, so the forums are rich with info :)

Maybe there should be a section about DB's, even though there is not so much asking about them, if looked in positive light, there will be lots of info, and later on would be more of a trouble finding and moving it..

Thanks again.
D.Bane.
Author:  jerome [ Mon Aug 30, 2010 8:27 pm ]
Post subject:  Re: Databases and ecere

Hi D.Bane,

Neither EDB nor SQLite have a concept of a database password.
As I said, you could always encrypt the contents of the data in the fields.
But that might be a bit overboard. If you leave it as it is, people would need an application that either understands EDB files or SQLite files to make sense of the data. And even then, depending on the data types you use in your database, it might not be so easy to make sense of it.

With Access people would just have to double click the .mdb file which would by default be associated with Access, and all data types are going to come up in the spreadsheet. So, it's really up to you if you want to go the extra mile and encrypt the contents of the data or not.

My bad, I thought eNotepad had MDI. There might have been a version at one point that had MDI in it... OpenRider is fun! :D

I do recommend you to chose the SQLite EDA driver rather than EDB in your case. EDB would really only be good if you want the most minimalistic system possible. So when you select SQLite as your EDA driver, it will automatically pick up the EDASQlite.dll containing the SQLite engine in it.

There are plenty of ways to help :D If you are interested in getting more involved in the Ecere development, please let me know! But I suggest you take a while to play around and get familiar with it first. But yes, asking questions and enriching the forums is a very good way!

Thanks,

Jerome
Author:  D.Bane [ Fri Sep 10, 2010 12:15 pm ]
Post subject:  Re: Databases and ecere

jerome wrote: OpenRider is fun! :D
Most certainly is :D
jerome wrote: There are plenty of ways to help :D If you are interested in getting more involved in the Ecere development, please let me know!
I would be really interested in helping, for now I'm not even close to the level of you guys, but if there is some way, than please tell me :)

I thought of writing some code in vb and ecere to show the people how nice it is :) and how little of code it needs to have to do it..But after I finish connecting (design db,make it all work..) my program to db.

Ooo..I haven't known about password in SQLite..I worked with .mdb and mySQL.. so I don't want someone to open up db in notepad and read everything, or to double click and see it all (I konw about protecting mdb, but also that it takes 5 second to crack the 15 letter password in it too using programs freely downloadable on net...)

I thought of making the edb system as temp storage, and SQLite as primary, so I can maybe find something to add/correct in edb.. and to get more familiar with it, since it takes a small footprint..

Just to say (if someone needs convincing):
vb6 project was demanding about 400MB or more (dlls to use mdb, dlls to use vb6, + all the space that program takes) and ec project total..what 30 MB with SQLite? (I don't know how much the SQLite takes.. project takes up very very little)..

Have a nice and productive days everyone :D
D.Bane
Author:  jerome [ Fri Sep 10, 2010 12:40 pm ]
Post subject:  Re: Databases and ecere

If you look in your Program Files/Ecere SDK/bin folder, you'll see EDASQLite.dll .
It takes up 400k.
That's 400k less you need for your application if you chose EDB, which is bundled within the core EDA dll (which takes up 131k altogether).

At the moment I suggest you stick with either of them.
Certainly it would be nice to be able to use the 2 drivers at the same time, one for temp storage and the other for primary, but at the moment that would be quite difficult to get it all to work together. We definitely should support that in the future. We should also improve EDB to make it more robust and survive make the database unexpected termination :)

Cheers,

Jerome

PS: There's no doubt that Ecere/eC is a light solution :D that's its reason to exist :P
Author:  D.Bane [ Fri Sep 10, 2010 3:00 pm ]
Post subject:  Re: Databases and ecere

Than it's less than 5 mb :D

Every day I'm even more impressed with ec and ecere :)

Well, I'll make the SQLite work, and try to make it work with EDB..Is there any particular reason why it doesn't work (with ease)?
Author:  jerome [ Fri Sep 10, 2010 3:52 pm ]
Post subject:  Re: Databases and ecere

The immediate problem would be to make it work with 'both' in the same application at the same time.

Also, as I said before there are some discrepancies in the way the EDA drivers for EDB and SQLite work...
One driver supports doing things one way, and the other another way.

Also, right now a database schema would associate database object with a single database/datasource, so this would be the key issue.
Author:  redj [ Sat Sep 11, 2010 10:03 am ]
Post subject:  Re: Databases and ecere

Hey D.Bane,

I just thought I'd let you know I've spent some time exploring the use of SQLCipher in an EDA driver that we'll call SQLiteCipher (EDASQLiteCipher.dll -- 509KB) and it seems to work like a charm!

Just use the DataSource's password property before you open the database. If you're using the SQLite driver, you should be able to switch to the SQLiteCipher driver without changing your code except for that one line!

Code: Select all

ds.password = "mybigsecretpassphrase";
SQLCipher uses OpenSSL for encryption so you need a few OpenSSL binaries installed on your system in order to use EDASQLiteCipher.dll successfully. This website has windows installers to help you with that. Just download and install "Win32 OpenSSL v1.0.0a" (8MB) or the smaller "Win32 OpenSSL v1.0.0a Light" (1MB) and you should be in business.

Here are the new binaries (including EDASQLiteCipher.dll) and the new source for EDA, EDASQLite and EDASQLiteCipher for Win32.

I hope it's useful.

-redj
Author:  D.Bane [ Wed Sep 15, 2010 3:20 am ]
Post subject:  Re: Databases and ecere

Thanks redj :)

Well my philosophy is that I need to do everything that is on my part, and let the user of my program just click away, with as easiest the installer possible, and as little of work on their behalf as possible too.

But it will be quite needed in other project, that's going to start the building process soon, at least I hope :)

PS: It's very useful :D

Thanks to all. Have a nice coding :D
D.Bane
All times are UTC-05:00 Page 1 of 1