Feature Requests for EoD SQL

I’ve had a few (ie: 2) requests and inquiries for new features on EoD SQL. Here is the list so far:

  1. The optional ability to use JDBC batch functionality (optional because not all drivers support it)
  2. A way to use stored procedures from your query interface (probably a new annotation)

I will be working on these features soon (hopefully), although I’d like some input on the first one. How should this be implemented? You don’t want to force batching on a specific query. One option I thought of is a new “BatchUpdate” return type:

public interface MyQuery extends BaseQuery {
    @Update(sql="INSERT INTO users (name, password) VALUES(?{1.name}, ?{1.hashedPassword})",keys=GeneratedKeys.RETURNED_KEYS_COLUMNS_SPECIFIED)
    public BatchUpdate<User> createUser(User user);
}

Which you could then use as:

MyQuery query = QueryTool.getQuery(MyQuery.class);
BatchUpdate<Update> update = query.createUser(null);
query = update.getQuery();

for(User u : users) {
    query.createUser(u);
}

query = update.commit();

getQuery() acts a bit like a “Stack.push()” operation, while commit() acts like the “pop()”. There are loads of other possibilities on implementation here. Haven’t really gone into how the keys will work here, but you can imagine. Let me know what you think!

If you have a feature request, or if you are using EoD SQL for anything: comment! I’m always looking for feedback.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: