Querying objects using the OQL interpreter

To query all persons in the database, launch an eyedboql session as in:

% eyedboql -d foo
Welcome to eyedboql.
  Type `\help' to display the command list.
  Type `\copyright' to display the copyright.
? select Person;
= bag(2597.2.134950:oid, 2595.2.683802:oid, 2589.2.36448:oid, 2587.2.702511:oid, 2585.2.196439:oid)
To query all persons whose firstname is ``john'':
? select Person.firstname = "john";
= bag(2585.2.196439:oid)
? \print
Person {2585.2.196439:oid} = { 
        firstname = "john";
        lastname = "wayne";
        age = 72;
        addr Address = { 
                num = NULL;
                street = NULL;
                town = NULL;
                country = NULL;
        };
        *spouse = {2587.2.702511:oid};
        children set<Person*> = set { 
                name = "";
                count = 3;
        };
};
Note that the
print
command allows to display the contains of the last objects returned on your terminal.

To query all persons whose firstname contains a y:
? select Person.firstname ~ "y";
= bag(2597.2.134950:oid, 2595.2.683802:oid, 2589.2.36448:oid, 2587.2.702511:oid)



EyeDB manual