How to deal with patching
See original GitHub issueI’m working with an API that streams changes to models in real time, and the payload is a JSON object containing only the fields that changed.
What is the suggested way to patch those changes in? The only thing I could think of is:
CREATE TABLE User (
id TEXT PRIMARY KEY NOT NULL DEFAULT "0",
token TEXT NOT NULL DEFAULT "",
deviceId TEXT NOT NULL DEFAULT "",
birthday TEXT AS LocalDate
);
updateId:
UPDATE CurrentUser SET id = :id;
updateToken:
UPDATE CurrentUser SET token = :token;
updateDeviceId:
UPDATE CurrentUser SET deviceId = :deviceId;
updateBirthday:
UPDATE PersistedCurrentUser SET birthday = :birthday;
fun updateUser(json: JsonObject) {
if(json.contains("id")) query.updateId(json.get("id").asString)
if(json.contains("token")) query.updateToken(json.get("token").asString)
if(json.contains("deviceId")) query.updateDeviceId(json.get("deviceId").asString)
if(json.contains("birthday")) query.updateBirthday(json.get("birthday").asLocalDate)
}
I don’t think a function can be generated that only updates explicitly defined columns (what would the default argument be, since null
can’t be used; what if you want to set the column to null).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to handle patch management - Network World.com
Open season on clients ; Do ; Establish a team or appoint an individual to monitor for new. vulnerabilities. ; Create a process...
Read more >What is Patch Management? Benefits & Best Practices - Rapid7
Patch management is the process of distributing and applying updates to software. These patches are often necessary to correct errors (also referred to...
Read more >How to Get a Handle on Patch Management | Threatpost
Best practices, according to Graham, include creating a patching cadence based on vendor releases. IT should also identify and prioritize ...
Read more >8 Patch Management Best Practices You Should Know About
Another thing to do when handling patch management is to ensure that you have a clear patch management policy that you'll follow with...
Read more >How to Handle Updates and Patches Properly - MSP360
Manage Patches on a Per-User Basis. Don't take a one-size-fits-all approach to patches and updates. Tailor your patch management policies and schedules to ......
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
It’s a bit verbose, but I’ve gotten used to it by now. I’ve really been appreciating the simplicity of SqlDelight, and I’m kind of happy that this isn’t being done.
ayyy happy to hear that