eyedboql is a tool that allows you to execute interactively OQL statements. This tool is similar to the Oracle sqlplus and Sybase isql well known tools.
$ eyedboql Welcome to eyedboql. Type `\help' to display the command list. Type `\copyright' to display the copyright. ?The string ``? `` is the default prompt for eyedboql.
$ eyedboql Welcome to eyedboql. Type `\help' to display the command list. Type `\copyright' to display the copyright. ? 1+3; = 4 ?The string ``= '' preceedes the result atom (if any) of your statement; in the current example, the result atom is the evaluation of the expression statement 1+3;.
? 1+ >> 3 >> ; = 4while the input sequence ``{ a := 1+3;newlinec := 2+94;newlined := a+c}'' gives:
? { a := 1+3; >> c := 2+94; >> d := a+c} ?Note that no ``= result atom'' is echoed because a compound statement does not return any atom.
? while (true) { >> a++; >> b++; >> } >> >> ; ?shows the necessity of typing a semicolon after the while statement although a while statement does not need to end by a semi-colom in the OQL specifications.
full : loads and displays object using the full recursive modeFor instance ``
ctime : displays the creation time of the object
mtime : displays the last modification time of the object
contents : displays the contents of collections
native : displays the native attributes
all : means ``ctime mtime contents native''
$ eyedboql Welcome to eyedboql. Type `\help' to display the command list. Type `\copyright' to display the copyright.open the database person in read-write mode:
? \open person rwget the first person whose name is "john" and display it:
? john := first(select Person.name = "john"); = 66373.12.4008447:oid ? \print 66373.12.4008447:oid Person = { name = "john"; age = 32; addr Address = { street = "clichy"; town = "Paris"; country = NULL; }; cstate = Sir; *spouse 66891.12.2738687:oid; cars set<Car*> = set { name = ""; count = 4; dimension = 1; reference = true; magorder = 4; }; children array<Person*> = array { name = ""; count = 0; range = [0,0[; dimension = 1; reference = true; magorder = 4; }; x = NULL; };change the name of john to "JOHNNY":
? john.name := "JOHNNY"; = "JOHNNY"retrieve the person whose name is "JOHNNY" and compares it to john using assert : all is fine, no error is raised!
? assert(john = first(select Person.name = "JOHNNY"));abort the transaction and look for the person whose name is "JOHNNY": no person is returned! this is ok as the transaction was aborted:
? \abort ? select Person.name = "JOHNNY"; = list()change the name of john to "JOHNNY" again and commit the transaction:
? john.name := "JOHNNY"; = "JOHNNY" ? \committhen retrieve again the person whose name is "JOHNNY" and compare it to john using assert: all is fine, no error is raised!
? assert(john = first(select Person.name = "JOHNNY"));quit eyedboql session
? \quit $We are going to conclude this section by this important note:
Program Options:For instance, to execute the statement ``delete_from(Person)'' on the database person:
-d <name>, -database=<name> Database name
-r, -read Open database in read mode
-w, -read-write Open database in read/write mode
-s, -strict-read Open database in strict read mode
-l, -local Open database in local mode
-c <command>, -command=<command> OQL command to execute
-p, -print Display all the objects loaded
-full Full recursive mode is used to display objects
-commit Commits the current transaction on close
-i, -interact Enter interpreter after executing file or commands
-e, -echo Echo each command
-admin Open database in admin mode
-h, -help Display this message
<file> File(s) to execute
Common Options:
-U <user>|@, -user=<user>|@ User name
-P [<passwd>], -passwd[=<passwd>] Password
-host=<host> eyedbd host
-port=<port> eyedbd port
-inet Use the tcp_port variable if port is not set
-dbm=<dbmfile> EYEDBDBM database file
-conf=<conffile> Configuration file
-logdev=<logfile> Output log file
-logmask=<mask> Output log mask
-logdate=on|off Control date display in output log
-logtimer=on|off Control timer display in output log
-logpid=on|off Control pid display in output log
-logprog=on|off Control progname display in output log
-error-policy=<value> Control error policy: status|exception|abort|stop|echo
-trans-def-mag=<magorder> Default transaction magnitude order
-arch Display the client architecture
-v, -version Display the version
-help-eyedb-options Display this message
$ eyedboql -d person -w -c "delete_from(Person)" $To execute the command ``persons := (select Person)'' and then enter the interactive mode of eyedboql:
$ eyedboql -d person -w -c "persons := (select Person)" -i Welcome to eyedboql. Type `\help' to display the command list. Type `\copyright' to display the copyright. ?To execute the file mylib.oql:
$ eyedboql -d person -w mylib.oql
EyeDB manual