-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sqlite support #1770
base: main
Are you sure you want to change the base?
Add sqlite support #1770
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion. It would make sense to include an additional dialect. Can you also include the JDBC driver changes necessary in pom.xml
? We can look into test cases.
spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/dialect/DialectResolver.java
Outdated
Show resolved
Hide resolved
...relational/src/main/java/org/springframework/data/relational/core/dialect/SQLiteDialect.java
Outdated
Show resolved
Hide resolved
...relational/src/main/java/org/springframework/data/relational/core/dialect/SQLiteDialect.java
Outdated
Show resolved
Hide resolved
...relational/src/main/java/org/springframework/data/relational/core/dialect/SQLiteDialect.java
Outdated
Show resolved
Hide resolved
...relational/src/main/java/org/springframework/data/relational/core/dialect/SQLiteDialect.java
Outdated
Show resolved
Hide resolved
We discussed this effort as a team and concluded two things:
Once the second item is addressed we can look for a way to integrate the dialect. For the time being, if you keep the code on your project, you can use the |
Any update on the subject ? |
|
||
@Override | ||
public String getOffset(long offset) { | ||
throw new UnsupportedOperationException("offset alone not supported"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do better, like LIMIT -1 OFFSET %d
. According to official documentation it is fine to set LIMIT
to the negative value.
} | ||
|
||
@WritingConverter | ||
private enum LocalDateTimeToNumericConverter implements Converter<LocalDateTime, Long> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We need to handle other JSR310 types as well.
- Can we safely assign UTC as a timezone to the
LocalDateTime
? I do not think so. I think we should not introduce the converters forLocalDate
/LocalTime
/LocalDateTime
here, since we can cause bugs for users. It is better for them that the framework would not handle these types out of the box, rather than saving them assuming the UTC
@Override | ||
public Collection<Object> getConverters() { | ||
Collection<Object> converters = new ArrayList<>(super.getConverters()); | ||
converters.add(LocalDateTimeToNumericConverter.INSTANCE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't tried this dialect, but since sqlite, doesn't support boolean tye the same as everyone else, we should probably add a conversion for this too
I wanted to contribute with an SQL dialect for the project. I have tested it on my system and it works.