fabriciofx / cactoos-jdbc Goto Github PK
View Code? Open in Web Editor NEWObject-Oriented wrapper to JDBC
License: MIT License
Object-Oriented wrapper to JDBC
License: MIT License
As we already have discussed before, I don't know if these names, like XxxToYyy
are good.
Indeed, I'm not sure about them yet. But, today, I believe XxxAsYyy
or XxxAdapterForYyy
could be better names.
What do you think?
Server
interface extends Closeable
with is old and exists only for compatibility. The right way is to use AutoCloseable
instead. So let's refactor it.
Let's update all dependencies.
ANTLR produces the following warning:
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7
We should create ResultSetAsJson which will implement Scalar and returns properly formatted JSON.
Let's refactor Params
to improve architectural design. It should be a interface and let's move the implementation to another class.
Let's configure pdd and 0pdd.
it would be nice to have keyset pagination here
For having reproducible unit tests, it would be very useful to employ docker-composer to create containers with MySQL, Postgres, etc.
There is no automate building provider, let's use rultor to do this automation
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
pom.xml
com.jcabi:parent 0.67.0
org.apache.maven.plugins:maven-compiler-plugin 3.13.0
org.apache.maven.plugins:maven-surefire-plugin 3.2.5
org.apache.maven.plugins:maven-resources-plugin 3.3.1
org.cactoos:cactoos 0.55.0
org.slf4j:slf4j-api 2.0.13
org.slf4j:slf4j-reload4j 2.0.13
org.llorllale:cactoos-matchers 0.25
com.h2database:h2 2.2.224
com.mysql:mysql-connector-j 8.4.0
org.postgresql:postgresql 42.7.3
com.jcabi:jcabi-xml 0.29.0
com.jcabi:jcabi-matchers 1.7.0
org.testcontainers:testcontainers 1.19.7
org.testcontainers:mysql 1.19.7
org.testcontainers:jdbc 1.19.7
org.testcontainers:postgresql 1.19.7
junit:junit 4.13.2
org.hamcrest:hamcrest-core 2.2
org.junit.jupiter:junit-jupiter 5.10.2
org.junit.jupiter:junit-jupiter-api 5.10.2
org.junit.vintage:junit-vintage-engine 5.10.2
org.testcontainers:testcontainers-bom 1.19.7
com.qulice:qulice-maven-plugin 0.22.2
org.jacoco:jacoco-maven-plugin 0.8.12
In ParsedSql class you have the following pattern
Pattern find = Pattern.compile("(?<!')(:[\w])(?!')");
Then you use substring(1) from matched strings , maybe it would be better to use this pattern instead
Pattern.compile("(?<!'):([\w])(?!')")
And then
while (matcher.find()) {
fields.add(matcher.group(1));
}
Let's change the usage of oraclejdk8
to openjdk8
in Travis CI due license issues.
Let's update Copyright notice to 2019.
In Elegant Object Vol. 2, section 6.5.6 Too many round trips, Yegor discuss about the problem of many round trips to RDBMS, to fetch data from each SQL Speaking Object (SSO). A solution to this problem is use a FakeConnection
class (here it will be called Cached
) that will cache all data of each SSO. But to implement a caching decorator to JDBC API it isn't trivial. We need implement a SQL parser and analyser to check each SQL statement to perform correctly (store or retrieve) data.
The API to be used by the developer should be something like:
public final class Cached implements Session {
...
}
final Session session = new Cached(
new SessionAuth(
new SourceH2l("test"),
"foo",
"bar")
)
);
Travis build is currently failing with:
[WARNING] /home/travis/build/fabriciofx/cactoos-jdbc/src/test/java/com/github/fabriciofx/cactoos/jdbc/server/ServerMysqlTest.java:[42,20] auto-closeable resource com.github.fabriciofx.cactoos.jdbc.Server has a member method close() that could throw InterruptedException
This is a bug in the JDK.
... because
void close() throws Exception
means thatInterruptedException
(a child ofException
) "could" be thrown... which is the signature ofAutoCloseable
.
Taken from a (comment)
So the way I see it, a temporary solution is to add a default
method to Server
with a more specific exception type.
@amihaiemil I've read your post An Extension To TellDontAsk and I liked very much. Congratulations! So, based on it, I'm thinking change the SqlContacts
code here to return a Contacts
instead of a List<Contacts>
. To achieve this, I must implement a FilteredContacts
, as you've suggested on post. So, my doubt is: how do you think should be the constructor signature? FilteredContacts(final List<Contacts> found, final String name)
?
For use it in project we should have download jar from sonatype repository.
Let's rename Param value attribute to be different of parameter value name.
Sometimes we need a sql script that containts nothing. So, let's create a ScriptSqlEmpty
which represent an empty sql script.
I haven't understand this part. There is a loop and the val
variable is replaced every time in the loop. Why is that?
I find it very difficult to test classes from com.github.fabriciofx.cactoos.jdbc.rset, because real data in database is required. In SelectTest.select() there is a code that can be used for that purpose. How about moving it to object that will make possible to reuse it?
Let's refactor Script
and ScriptSql
to improve design.
Let's implements Constraints concept to Agenda demo.
I believe this class, KeydQuery, is a typo.
Should it be KeyedQuery
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.