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

Missing a "Create database" command #63

Closed
BrightSoul opened this issue Mar 9, 2019 · 5 comments
Closed

Missing a "Create database" command #63

BrightSoul opened this issue Mar 9, 2019 · 5 comments

Comments

@BrightSoul
Copy link

Hey there,
suppose I'm starting a new project and I need to create a new Sqlite database. A "Create database" command would be so useful, so that I don't have to download/use the Sqlite CLI just for this one-time task.

Thanks for this extension!
Moreno

@BrightSoul
Copy link
Author

BrightSoul commented Mar 9, 2019

Just to clarify: I know I can just create a new empty file and name it database.db, and then run a CREATE TABLE comand against it using this extension. However, I think it would be more user-friendly to just have a 'Create database' command and select it as the current database for subsequent queries.

Moreover, when I try to use the "Open Database in Explorer" command on an empty database (file of size 0), nothing happens. I think this is confusing. The database should appear in the Sqlite Explorer even if it's of size 0.

@AlexCovizzi
Copy link
Owner

Moreover, when I try to use the "Open Database in Explorer" command on an empty database (file of size 0), nothing happens. I think this is confusing. The database should appear in the Sqlite Explorer even if it's of size 0.

That's a bug, already fixed in the master branch.

Create database will be added for release 0.6.0, that should come soon.

@BrightSoul
Copy link
Author

Cool, thanks for your quick reply!

@AlexCovizzi
Copy link
Owner

Moreover, when I try to use the "Open Database in Explorer" command on an empty database (file of size 0), nothing happens. I think this is confusing. The database should appear in the Sqlite Explorer even if it's of size 0.

This is fixed in version 0.6.0.

Regarding the command Create database i did not implement it.
What i wanted to do was something like the command File: New File where you can create the file directly in the files explorer and then an sql file already bound to the database is automatically created and opened.
However the vscode api is very limited for the files explorer, and there is no way of implementing something similar to File: New File.
To make your use case a little better i added a New Query option in the files explorer, when right clicking the database, so the process of creating a new database and opening an sql file bound to it is now:
File: New File > [right click the new database] > New Query
Instead of:
File: New File > SQLite: New Query > Use Database > [select the new database]

@BrightSoul
Copy link
Author

However the vscode api is very limited for the files explorer, and there is no way of implementing something similar to File: New File.

Ok, it can't be helped then, I guess. Thanks you for your effort @AlexCovizzi, I've really appreciated it.

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

No branches or pull requests

2 participants