1. Euphoria + Database
- Posted by Anthill Oct 28, 2010
- 2081 views
I need to write a web application that uses either sqlite or mysql. I use Linux (unbutu) as a platform. I am not sure EU will do this, and if so what version (3.x or 4 beta).
What I currently understand is that version 4 beta supports sqlite but currently only works with windows. Version 3 only uses a native db which wont work for my application. So is version 4 stable enough and when might the Linux version be available?
Btw this will be my first Eu project.
Thanks for your advise.
2. Re: Euphoria + Database
- Posted by jimcbrown (admin) Oct 28, 2010
- 2115 views
I need to write a web application that uses either sqlite or mysql. I use Linux (unbutu) as a platform. I am not sure EU will do this, and if so what version (3.x or 4 beta).
What I currently understand is that version 4 beta supports sqlite but currently only works with windows. Version 3 only uses a native db which wont work for my application. So is version 4 stable enough and when might the Linux version be available?
Btw this will be my first Eu project.
Thanks for your advise.
Version 4 beta supports using mysql on Linux via edbi (not to be confused wth eds, the native database). edbi has some issues handling error conditions, but it's stable enough to run this website.
3. Re: Euphoria + Database
- Posted by euphoric (admin) Oct 28, 2010
- 2052 views
I need to write a web application that uses either sqlite or mysql. I use Linux (unbutu) as a platform. I am not sure EU will do this, and if so what version (3.x or 4 beta).
Definitely use version 4. It's almost at RC status anyway, so it's very stable. It's being used to run this web site with MySQL as the database on a Debian Linux server.
You'll also want (need?) EDBI. A great lib from Jeremy Cowgar that makes it extremely easy to use any database you want (as long as it's MySQL or SQLite for now). :)
4. Re: Euphoria + Database
- Posted by ChrisB (moderator) Oct 29, 2010
- 2000 views
Hi
Eu 3 and eu 4 on Linux both work with sqlite. I use eu 4 (usually most up to date build) on my veterinary database, which uses sqlite, and runs on Linux. Its blisteringly fast, and incredibly easy to maintain. Because Linux printing is such a PITA, I run Linux on virtualbox at 2 of my surgeries (if the third ever needs a new printer, I'll convert that to virtualbox( running on Windows, its still fast, and no one notices.
The sqlite wrapper is cross platform, and eu3 and 4 compatible.
Chris
5. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1820 views
I installed the edbi libraries. However upon running this on linux I got an error: edbi.e:344 in function open(). So I printed out 'dll_name1' in edbi.e and it points to drivers/sqlite3/edbi_sqlite3.so. This file does not exist. Under drivers/sqlite are the following files:
edbi_sqlite3.c euinit.c Makefile sqlite3ext.h edbi_sqlite3.dll euinit.h sqlite3.c sqlite3.h
So, since I am very new to euphoria, is there a edbi_sqlite3.so file or is it something I will need to compile. If so how will I do this?
Thanks...
6. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1871 views
I installed the edbi libraries. However upon running this on linux I got an error: edbi.e:344 in function open(). So I printed out 'dll_name1' in edbi.e and it points to drivers/sqlite3/edbi_sqlite3.so.
I'm sorry, as with any new project (seems like) documentation and fine polishing is lacking.
This file does not exist. Under drivers/sqlite are the following files:
edbi_sqlite3.c euinit.c Makefile sqlite3ext.h edbi_sqlite3.dll euinit.h sqlite3.c sqlite3.h
So, since I am very new to euphoria, is there a edbi_sqlite3.so file or is it something I will need to compile. If so how will I do this?
The .so file may be different per Linux install. You should be able to
[edbi] $ cd drivers/sqlite [edbi/drivers/sqlite3] $ make
If all goes as planned, you should then have a edbi_sqlite.so. If not, can you follow up with a post containing the output of the above make command?
7. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1829 views
If all goes as planned, you should then have a edbi_sqlite.so. If not, can you follow up with a post containing the output of the above make command?
Jeremy, here are my make output errors...
root@anthill:/usr/share/euphoria/include/drivers/sqlite3# make
gcc -DEFree=free -DEMalloc=malloc -DERealloc=realloc -fomit-frame-pointer -fPIC -c -w -fsigned-char -O3 -mno-cygwin -mwindows -IC:/Development/Projects/Euphoria/include -I.. -DESIMPLE_MALLOC sqlite3.c -o sqlite3.o
cc1: error: unrecognized command line option "-mno-cygwin"
cc1: error: unrecognized command line option "-mwindows"
make: * [sqlite3.o] Error 1
Thanks for your quick reply...
8. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1829 views
Jeremy, here are my make output errors...
root@anthill:/usr/share/euphoria/include/drivers/sqlite3# make gcc -DEFree=free -DEMalloc=malloc -DERealloc=realloc -fomit-frame-pointer -fPIC -c -w -fsigned-char -O3 -mno-cygwin -mwindows -IC:/Development/Projects/Euphoria/include -I.. -DESIMPLE_MALLOC sqlite3.c -o sqlite3.o cc1: error: unrecognized command line option "-mno-cygwin" cc1: error: unrecognized command line option "-mwindows" make: *** [sqlite3.o] Error 1
Hm. It seems to be choosing the Windows Makefile, please try
[edbi/drivers/sqlite3] $ make -f GNUmakefile
That should do the trick. If it fails again, please do the same and include the makefile output. sorry about this! Once EU 4.0 is out, EDBI is something of primary concern for me (and a few others) so much work will go into completing the docs and general polishing (like installing!).
Also, when you want to put a lot of "console" or "pre-formatted" text in you can use:
{{{
Hello
World
}}}
which comes out like
Hello World
Jeremy
9. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1806 views
Hm. It seems to be choosing the Windows Makefile, please try
[edbi/drivers/sqlite3] $ make -f GNUmakefile
There was no GNUmakefile included in edbi.
root@anthill:/usr/share/euphoria/include/drivers/sqlite3# make -f GNUmakefile make: GNUmakefile: No such file or directory make: *** No rule to make target `GNUmakefile'. Stop.
Thanks.
10. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1831 views
There was no GNUmakefile included in edbi.
Oh hm. I recently changed the locations of my repos and the GNUmakefile was a recent addition. I have moved from using SVN. I'm terribly sorry for the difficulties you are having with this, it really shouldn't be this difficult.
Please see: http://bitbucket.org/jcowgar/edbi/wiki/Home
If you do not use Mercurial, then you can download a zip or tar.gz right from that page. See the far right icon that looks like a white page with a blue down arrow.
Give that a try and I sure hope that time it works for you.
Jeremy
11. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1801 views
Please see: http://bitbucket.org/jcowgar/edbi/wiki/Home
If you do not use Mercurial, then you can download a zip or tar.gz right from that page. See the far right icon that looks like a white page with a blue down arrow.
Give that a try and I sure hope that time it works for you.
After fixing my EUDIR environmental variable I seem to be much closer... however I am missing the file /usr/share/euphoria/bin/eu.a
root@anthill:/usr/share/euphoria/include/drivers/sqlite3# make -f GNUmakefile gcc -c -DEFree=free -DEMalloc=malloc -DERealloc=realloc -fomit-frame-pointer -fPIC -w -fsigned-char -O3 -I/usr/share/euphoria/include -I.. -DESIMPLE_MALLOC euinit.c -o euinit.o gcc -c -DEFree=free -DEMalloc=malloc -DERealloc=realloc -fomit-frame-pointer -fPIC -w -fsigned-char -O3 -I/usr/share/euphoria/include -I.. -DESIMPLE_MALLOC edbi_sqlite3.c -o edbi_sqlite3.o gcc -shared -o edbi_sqlite3.so sqlite3.o euinit.o edbi_sqlite3.o \ /usr/share/euphoria/bin/eu.a gcc: /usr/share/euphoria/bin/eu.a: No such file or directory make: *** [edbi_sqlite3.so] Error 1
Where can I get this file?
Once again thanks
12. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1769 views
After fixing my EUDIR environmental variable I seem to be much closer... however I am missing the file /usr/share/euphoria/bin/eu.a
... SNIP ...
Where can I get this file?
That should have been installed when Euphoria was installed. How did you install Euphoria?
Once again thanks
Not a problem, I appreciate you bearing with me as we work though these bugs.
Jeremy
13. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1766 views
I downloaded Euphoria Debian package from this web site a few days ago (2010-08-26):
http://openeuphoria.org/downloads/index.wc
Linux (x86) Debian package euphoria_4.0.beta.4-1ubuntu1_i386.deb
14. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1723 views
I downloaded Euphoria Debian package from this web site a few days ago (2010-08-26):
http://openeuphoria.org/downloads/index.wc
Linux (x86) Debian package euphoria_4.0.beta.4-1ubuntu1_i386.deb
Ok, this seems to be a problem with the makefile. It's assuming eu.a is in your $EUDIR/bin directory (windows location and where it is on my development box).
Line 19 of GNUmakefile reads:
$(EUDIR)/bin/eu.a
Replace that with:
/usr/lib/eu.a
and things should work. Be careful as the GNUmakefile needs indented with a tab. It does not like spaces.
Let me know how this works for you. I'll have to come up with some other way of determining where the eu.a file is installed at.
Jeremy
15. Re: Euphoria + Database
- Posted by Anthill Nov 01, 2010
- 1750 views
Yes! It works...
I will write up a summary later tonight on what I needed to do to get euphoria, edbi, sqlite3, and linux working. This rocks!
THANKS Jeremy
16. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 01, 2010
- 1698 views
Yes! It works...
Finally!
I will write up a summary later tonight on what I needed to do to get euphoria, edbi, sqlite3, and linux working. This rocks!
That would be nice to have.
THANKS Jeremy
You're welcome and thanks for sticking through it. wiki:EDBI is still a bit rough around the edges but if you treat it nice, it works pretty good
Jeremy
17. Re: Euphoria + Database
- Posted by Anthill Nov 02, 2010
- 1684 views
- Last edited Nov 07, 2010
Here is a summary of my notes for getting euphori + edbi + sqlite3 on linux...
- Installed sqlite3
- Download and install the Linux (x86) Debian package from http://openeuphoria.org/downloads/index.wc
- Download and extract http://bitbucket.org/jcowgar/edbi/get/tip.tar.gz (from http://bitbucket.org/jcowgar/edbi/downloads under Tags & snapshots) to /usr/share/euphoria (include are: /usr/share/euphoria/edbi/drivers, /usr/share/euphoria/edbi/edbi, /usr/share/euphoria/edbi/examples, and /usr/share/euphoria/edbi/License.txt
- cd to /usr/share/euphoria/edbi/drivers/sqlite3
- modify GNUmakefile and change $(EUDIR)/bin/eu.a to /usr/lib/eu.a
- run the command: make -f GNUmakefile
- the file edbi_sqlite3.so should now be created
- cd to /usr/share/euphoria/edbi/examples
- modify example.ex and changed the db_handle so that it points to a local database edbi:open("sqlite3:///data/sqlite/TM"). Notice that three slashes for an absolute path.
- run: eui example.ex
The output should read:
Name=Ronald Mc'Donald, Zip=29382, Dob=11/01/1978 Name=Super Man, Zip=55555, Dob=05/18/1944 Name=Wonder Woman, Zip=21232, Dob=09/29/1972 Name=Ronald Mc'Donald, Zip=29382, Dob=11/01/1978 Name=Super Man, Zip=55555, Dob=05/18/1944 Name=Wonder Woman, Zip=21232, Dob=09/29/1972
I used SQLite Database Browser to verify the insertion of data
Thank Jeremy! By the way I saw that you also can fly a glider. That is something I always wanted to do.
18. Re: Euphoria + Database
- Posted by jeremy (admin) Nov 02, 2010
- 1645 views
Thanks for the writeup Anthill. I'm sure it will be of help to others.