winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.94k stars 194 forks source link

Postgres winglib does not retain state in simulator after reloading #6284

Closed staycoolcall911 closed 4 months ago

staycoolcall911 commented 5 months ago

Use Case

Postgres db is currently losing its state when the simulator is reloaded. The use case here is to use postgres populated with some test data and avoiding having to re-populate the data frequently.

Proposed Solution

The Postgres Winglib sim implementation should save state to a local dir, similar to what was done for cloud.Buckets in #5164

Implementation Notes

See #5164 which added this capability to cloud.Buckets

Component

Libraries

Community Notes

Chriscbr commented 5 months ago

I tested this locally - the state is retained as long as WING_ENABLE_INPLACE_UPDATES=true is enabled in your shell.

We have an issue for removing this feature flag here https://github.com/winglang/wing/issues/6185, so I'll mark this resolved - @staycoolcall911 feel free to reopen if needed

ekeren commented 5 months ago

I expect to have it serialized between wing ribs and not just in hotreloading

On Mon, Apr 22, 2024 at 18:54 Chris Rybicki @.***> wrote:

I tested this locally - the state is retained as long as WING_ENABLE_INPLACE_UPDATES=true is enabled in your shell.

We have an issue for removing this feature flag here #6185 https://github.com/winglang/wing/issues/6185, so I'll mark this resolved - @staycoolcall911 https://github.com/staycoolcall911 feel free to reopen if needed

— Reply to this email directly, view it on GitHub https://github.com/winglang/wing/issues/6284#issuecomment-2069994990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANFVK26FNLG3HXNLS76DGTY6UXDJAVCNFSM6AAAAABGRNLVTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRZHE4TIOJZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ekeren commented 5 months ago

I mean persistent between two new runs

ekeren commented 5 months ago

You'll notice that I am using this flag in package.json

Chriscbr commented 5 months ago

Ah, I misunderstood. Thanks @ekeren, makes sense 👍

I'll look into this, it feels like there should be some way to do this with the volumes option in sim.Container