mysticmind / mysticmind-postgresembed

Postgres embedded server equivalent including extensions for .Net applications
MIT License
143 stars 26 forks source link

_instanceId is not setabble, please clarify. #1

Closed maxfridbe closed 6 years ago

maxfridbe commented 6 years ago

Is this intentional, because then dbdir gets a new directory each time. Or am I misunderstanding this. When I launch and then relaunch the data is obviously not in the same directory

mysticmind commented 6 years ago

It is intentional, primarily around unit testing use cases where the database will need to be tear down and cleaned up.

If you have a requirement to reuse the same dbdir in rerun, I could look at handling the use case.

BlaikiC commented 6 years ago

Would it be quicker for the instanceid to be used only for the DataDir, and avoid extracting the binaries on each test run? Or is there a reason for the multiple pgsql dirs?

i.e. pg_embed pg_embed\binaries pg_embed\pgsql pg_embed\data\fb96b06d-9534-4be9-93b6-b6c3b83494e9

mysticmind commented 6 years ago

There is also support for pg extensions which you can configure hence the multiple pgsql dirs. I think we can add some logic to deal with the use cases not to create multiple pgsql dirs, will take a look at it sometime next week.

On Thu, 29 Mar 2018 17:11 Corin Blaikie, notifications@github.com wrote:

Would it be quicker for the instanceid to be used only for the DataDir, and avoid extracting the binaries on each test run? Or is there a reason for the multiple pgsql dirs?

i.e. pg_embed pg_embed\binaries pg_embed\pgsql pg_embed\data\fb96b06d-9534-4be9-93b6-b6c3b83494e9

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mysticmind/mysticmind-postgresembed/issues/1#issuecomment-377208834, or mute the thread https://github.com/notifications/unsubscribe-auth/ACu0UKCSqsxAY1Nv_jihAO7ThikR5QjEks5tjMhzgaJpZM4SVn0i .

mysticmind commented 6 years ago

New release v1.0.0 is available in NuGet. This provides the ability to create a named instance and reuse it by passing a Guid value for instanceId in the constructor. If an instance id folder already exists, system will skip the setup and just start the server. Please check the readme for more details.

Closing this issue.