Comments (8)
Can you give me some more details in what you're trying to achieve? Reset a value to that you have defined in withDefault
?
from drift.
I have created a value in database, and now I want to replace that value with a new object (which was created using the fromJson method)
from drift.
I am using update(xxx).replace(aaa)
from drift.
Sorry for the delay, but I think I still need more info. UpdateStatement.replace
should set fields that are null back to null in the database. If that's not happening it would be a bug in the library. If you need a different behavior, please explain what you'd expect to happen.
from drift.
I would expect the replace function to work exactly as create function. Remove the old row, and create a new row in its place.
from drift.
Sorry for the delay. This is pretty much the same problem as in #25. If a column is set to null we can't know if that's null as in "reset to the default value" or "override this column to NULL".
from drift.
This is only a problem, when the attribute is nullable. Secondly, I have read your comment on #25 too, and I would simply disallow default values for nullable attributes if I were you.
from drift.
This is now implemented on develop
- absent values will be replaced with their default value.
from drift.
Related Issues (20)
- Error: The argument type 'String?' can't be assigned to the parameter type 'String' HOT 6
- Migrate Android app plugin loader - examples HOT 4
- Illegal cast in web wasm HOT 1
- Improve remote protocol serialization on the web
- Insert Silently HOT 4
- `schema export --dialect postgres` produces invalid SQL for DateTimeColumn and BoolColumn when defaults are specified HOT 2
- Add documentation for the Drift DevTools Extension HOT 1
- Add new option to the DevTools extension to run build_runner HOT 1
- Documentation dark mode HOT 2
- Web WASM: "RuntimeError: illegal cast at InsertStatement.insert HOT 3
- Why withDefault is no effect?is this a bug? HOT 3
- Could not build Objective-C module 'SQLite3' HOT 2
- `distinct()` with `omit` parameter. HOT 3
- WEB: Failed to register a service worker: The script has an unsupported MIME type ('text/plain'). HOT 14
- ? Depreciate `drift_sqflite` and publish Migrations Guide ? HOT 2
- Nullable Columns Without Defaults use `Value` HOT 3
- Hot Reload & SchemaVersion HOT 2
- Generated Tests HOT 5
- is drift support 【HAVING COUNT...】? HOT 1
- SQL Parsing Error with Special Characters (e.g., $ , ''',#) in Query HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drift.