API generification
See original GitHub issueThis issue is rather an open discussion about how the client will handle multiple back-ends, the concerns we want to address are:
- naming the project and the package
- how to handle specific backend operations (PG has notifications/notices, MY has ping, etc…)
Current WIP for MySQL support https://github.com/reactiverse/reactive-pg-client/tree/mysql_support
Naming
- The Reactive SQL Client
io.reactiverse.sqlclient
- The Reactive DB Client
io.reactiverse.dbclient
io.reactiverse.rdbc
io.reactiverse.dbc
Specific operations
Proposal 1
- Provide a generic API in the project package that does not provide specific operations
- Each database has its own package and extends the generic API providing specific operations
Examples
public interface DbConnection {
}
public interface PgConnection extends DbConnection {
// Specific stuff here
}
Issues : we cannot really do this unless with use self bound generics ,i.e
public interface DbClient<C extends DbConnection> {
void connect(Handler<AsyncResult<C>> handler);
}
public interface PgClient extends DbClient<PgConnection> {
}
unless we don’t abstract PgClient ?
Proposal 2
Flat interface style, provide an API that exposes everything. It is simple but not ideal and certainly won’t help the user.
Issue Analytics
- State:
- Created 5 years ago
- Comments:27 (19 by maintainers)
Top Results From Across the Web
Java Management Extensions API Enhancements
Generification. The JMX API now fully supports Generics. ObjectName supports wildcards. key=* wildcards are now supported in ObjectName. Previously, "domain: ...
Read more >[JDK-8227541] Serial spec should be updated to reflect API ...
Backport - A issue that is required to port a Bug or Feature into another product JDK-8227863 Serial spec should be updated to...
Read more >Adopting 4.4 mechanisms and APIs - IBM
All of the APIs for Platform Debug have been generified in 4.4. If you have been using the platform debug code in generified...
Read more >[JDK-8227731] Serial spec should be updated to reflect API ...
The Serialization specification is updated to reflect changes made to the method signatures in previous JDK releases. For example, references to raw classes...
Read more >Generify A Java Project - Eclipsepedia
Generifying APIs requires special care: Communicate to API clients that you're going to generify APIs. Perform the work in a branch and only ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve pushed another commit that move more interfaces to the
sqlclient
package and now it looks ok to me.io.reactiverse.sqlclient
does not leak intoio.reactiverse.pgclient
for the main typesSqlConnection
toPgConnection
to access specific API, etc…I believe the PG specific datatypes will be removed from
Row
/Tuple
and can be used using type tokens:which can used this way:
I pushed the specific data type decoupling with PG in the branch https://github.com/reactiverse/reactive-pg-client/tree/api-test-1
I think this branch could be merged in the mysql-support branch as I think the result is satisfying for the moment