I’ve had a few (ie: 2) requests and inquiries for new features on EoD SQL. Here is the list so far:
- The optional ability to use JDBC batch functionality (optional because not all drivers support it)
- 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.