-
Notifications
You must be signed in to change notification settings - Fork 11
FlatPostgresCollection Create Doc Impl #266
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
base: main
Are you sure you want to change the base?
Conversation
| private final DataType canonicalType; | ||
| @Getter private final PostgresDataType postgresType; | ||
| private final boolean nullable; | ||
| private final boolean array; |
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.
Nit: isArray since array is a slightly confusing without looking at this line.
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.
Changed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
============================================
+ Coverage 80.51% 80.60% +0.09%
- Complexity 1385 1390 +5
============================================
Files 234 235 +1
Lines 6194 6348 +154
Branches 554 579 +25
============================================
+ Hits 4987 5117 +130
- Misses 831 848 +17
- Partials 376 383 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@suresh-prakash Can you take a look at the following:
|
Best-effort makes sense. But, most of the times such log messages are ignored though we may be setting them in the CreateResult. Rather I'd prefer we fail it so that the client can take a necessary action (they may choose to retry with the column ignored, if we throw a custom exception with meaningful info.).
This is fine, I guess, because that's the way the Mongo impl. works today. If I give an invalid selection, it doesn't throw. Rather avoids it in the JSON, which in turn results in a
100% makes sense. 🙂 |
Why retry on DATATYPE_MISMATCH? This can be a bad situation to be in. If client data type mismatches the db column type then retries won't help. DB Column data type change should never be the case in postgres. |
Well theoretically speaking, the rationale behind the retry is: Maybe the data type changed and the schema is stale, so refresh it and try again. |
|
@suresh-prakash I am not throwing an exception because it won't throw an exception in Mongo as well. So to keep the interface behaviour consistent, shall we stick to it? |
True. But silently neglecting seems dangerous. Most clients would be unware of it. While it may give the immediate compatibility, it could create far more issues later. Since this write path anyways require code changes in the clients, I still think it would be better to let the clients handle it rather than the library doing it behind the scenes. @kotharironak Thoughts here? |
|
@suresh-prakash How about a config to control this (in |
|
@suresh-prakash Have add a
Wdyt? |
This is a nice middle-ground. 🙂 Just a small suggestion though. Instead of a boolean, can we make it as an enum (say, |
Description
This PR implements
Collection#create(Key key, Document document)forFlatPostgresCollection.Testing
Checklist: