Re: dAtabase
- Posted by void <void at xs4all.nl> Jan 11, 2002
- 424 views
Matt: Do you have any idea when you're releasing the next version of EuSQL (within weeks/months/?) > > What database program is suitable for euphoria (simple) but > > I dont like EDS because no indexing support. Just database > > for local files, not database with server etc. > > Aku, > > You could check out EuSQL in the archives. It sits on top of EDS, providing > a SQL (Structured Query Language) front end, turning EDS into a relational > database. Much of it is still pretty rough, and the documentation isn't as > clear on some things as it should be, but I'm happy to respond to any > questions anyone might have. It currently does not support indexing, > although it should shortly. I'll be picking it back up here soon to work on > it. I'd be interested to hear more on what you plan to do, and why you're > interested in an indexed database. > > Here's a little bit on SQL, in case you're not familiar with it. First, > it's probably the most common database language, since it's used by Oracle, > MS SQL Server, Informix and DB2, to name some of the biggies. It allows you > to manipulate data in an almost english like manner: > > "SELECT NAME FROM EMPLOYEES WHERE NAME LIKE 'A*';" > > This command would return a list of employee names starting with 'A'. There > are similar ways to insert, update and delete records. The real benefits > come when you exploit the relational aspect of the database. It allows you > to establish relationships between tables. This means that you can store > the same amount of information in less space, but still have an easy way to > retrieve it. > > Suppose you have a table of employees, containing (but not limited to) > names, and another containing all of your company locations. You could have > put the location information in the employee table to keep track of where > everyone works, but this could lead to lots of errors (not to mention a lot > of duplicated data). But if you give each location an id (a number is nice, > since it doesn't take up a lot of space), and put the id in the employee > table, you save a lot of space. We do this all the time with linked > sequences, but it's a bit more complex with a database. Here's how you > might get a listing of employees and their locations: > > "SELECT EMPLOYEES.NAME, LOCATION.CITY, LOCATION.STATE FROM EMPLOYEES INNER > JOIN LOCATION ON EMPLOYEES.LOC_ID = LOCATION.LOC_ID" > > While EuSQL doesn't currently support indexing, it can make data > retrieval/manipulation much easier through queries. Also, it allows you to > structure tables into fields and subfields. The EDS key is used as the > EuSQL primary key, which uniquely identifies each record. As a user of > EuSQL, you don't have to worry about the difference between key/data as when > you're directly using EDS. > > I think it makes a nice compromise between Euphoria's flexible sequences and > a database's structured fields. You can embed fields within fields > (atoms/sequences within sequences) and access them using dot notation: > > NAME.FIRST > > Currently, no data type checking is done, although that's already > implemented for the next release. Database creation is manual right now, > although this will be automatically handled in the next release. > > Matt Lewis > > > >