Hi y'all,
So I've been discussing a crossdb version 2 with a friend and have come
up with some rough ideas:
Please give feedback on the ideas and let us know of any features that
you would like to see in a new release.
Travis
Travis Reeder wrote:
> What do you think of this stuff...
>
>
>
> Some new ideas....
>
> ----------------------------------------------
>
> Read in crossdb.properties file which will contain:
> database type or crossdb driver
> ex:
> database=mysql for standard supported ones
> or
> database=com.spaceprogram.sql.mysql...... for third party impls
>
> ----------------------------------------------
> Select s = SQLFactory.getSelect();
> s.from("tablex")
> s.where(x, s.EQUAL, y); or s.whereEqual(x, y);
> s.orderBy(x);
> s.groupBy(x);
> s.whereNotNull(x);
> s.get("colx"); // get is for columns
> s.whereNull(x);
> s.getDatePart(date, part);
> s.getConcat(List c);
> s.limit(start, offset);
> s.groupBy(x);
> s.sum(x);
> s.count(x);
> etc...
> rs = s.execute(conn);
>
> ----------------------------------------------
>
>
> Insert i = SQLFactory.getInsert();
> i.setTable("t");
> i.auto(colx);
> i.put(coly, val);
> i.execute(conn);
>
>
> // For auto database creation, you can register a table, if not made,
it will be made, if different, it will be altered
> Table t = new Table(name);
> t.addColumn("colx", java.sql.Types.INTEGER, int size);
>
> SQLFactory.register(t); // will call create if doesn't exist or
update if does
>
> or SQLFactory.create(t);
> or SQLFactory.update(t);
>
>
> ----------------------------------------------
> CrossdbResultSet will follow strict rules about date and time, etc,
at least so that every db returns the same results.
>
> ----------------------------------------------
>
> Support for ALL types in java.sql.Types
>
----------------------------------------------
I think it would be super rad if we had a built in layer .... perhaps an
xml configuration that could map the values that you expect in an
application to the actual DB values that a company has.... for example:
- I develop a sweet application that is a Contact Manager
- The appliction requires that I get basic information on the contact...
in my case:
Contact First Name = contact_fname
Contact Last Name = contact_lname
ect ....
- Compnay XYZ sees my contact manager and wants to build it into there
system.... unfortionatly the had a differnt naming scheme setup in there
db ... ie
Contect First Name = fname
Contact Last Name = lname
ect ....
If the was another layer that you could remap the values to a value
PROXY that you use in your app... i think that would be sweet ass.
Let me know if you think this is a wast of time or not.
Corey
----------------------------------------------
Some convenience classes like search(column, value); which would either
just be a select with some LIKE statements or could evolve to something
smarter like splitting the search phrase up and giving the return values
a rank.
|