Skip to content
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

Keep yessql.db as the fallback name for sqllite #15155

Closed
wants to merge 1 commit into from

Conversation

hishamco
Copy link
Member

Fixes #15154

@hishamco hishamco requested a review from MikeAlhayek January 23, 2024 20:27
@hishamco
Copy link
Member Author

Please try the PR on your old database, it SHOULD work

Cache = SqliteCacheMode.Shared,
Pooling = sqliteOptions.UseConnectionPooling
};
var dataSource = Path.Combine(databaseFolder, sqliteOptions.DatabaseName);
if (!File.Exists(dataSource))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't this this is a good idea to do IO operation for this. I still like the approach I recommended in the issue better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs on the first request to the tenant if I'm not wrong

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to store the database name in the shellsetting config file instead. The issue will still remain if people are not changing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If value is null from shellsettings then return "yessql.db". That could work. But you are adding a new setting that was not necessary before. Is the intent to add that config to the shellsettings to make this dynamic too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skrypt is saying the same recommendation I added here #15154

@hishamco I can submit alternative PR if you like just so you can compare the two.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense if the intent is to make this name configurable. I thought that the intent was to only change its default name. But yeah, to be honest I don't know what is the added value of making this name configurable from the shellSettings json file. Why would someone want to rename that file is the question?

It has always been a fixed value since the beginning but I'm not against the idea. Though, it will add complexity and it needs to be documented and it needs to throw if the DB is not found when someone puts in a random name in these shellshettings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might you the tenant's name while it's safe, the idea at the beginning to rid-off the yessql

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skrypt I remember the configuration was done mainly for backward compatibility, so you can yessql.db from within the configuration

For that this PR might not necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I don't like about making the Databasename configurable from the appsettings.json file is that it adds a failure point that was not there before. If we do this then at least we need to throw/log ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should care. If someone decided to screw up their appsettings file then their app won't work. Same as changing the tenant name or anything else like tablePrefix. I think we should use appsettings and assume that the file matches the name if one found otherwise yessql. I submitted a PR that fixes this issue #15157

@sebastienros
Copy link
Member

Please revert the PR that changed the database name. We'll put it back when the migration path is well-defined and the implementation is not brittle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep yessql.db as the fallback name for sqlite for backward compatability
4 participants