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

feat: create dbs and collections using playgrounds VSCODE-262 #294

Merged
merged 5 commits into from
May 28, 2021

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented May 27, 2021

Description

Change the way on how we create dbs and collections. Instead of using input boxes for db and collection names open a new playground template.

We should use one template for db and collection creation since there is no way to create db without a collection
The template should be a valid JS template with placeholders for db and collection names
If we create a collection for the existing db the template should pre-populate the db name
Show a time-series prototype form only for Server 5.0 and later.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@alenakhineika alenakhineika requested a review from addaleax May 28, 2021 07:06
Comment on lines 258 to 260
const serverVersion = buildInfo.version.replace(/-.*$/, '');

if (semver.satisfies(serverVersion, '>= 5.0')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const serverVersion = buildInfo.version.replace(/-.*$/, '');
if (semver.satisfies(serverVersion, '>= 5.0')) {
const serverVersion = buildInfo.versionArray[0];
if (serverVersion >= 5) {

since versionArray is the machine-accessible variant of version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced version with versionArray.

Copy link
Contributor

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Looks great!

@alenakhineika alenakhineika merged commit a1761fa into master May 28, 2021
@alenakhineika alenakhineika deleted the VSCODE-262-create-collections-using-playgrounds branch May 28, 2021 11:15
@Anemy Anemy mentioned this pull request Jun 16, 2021
@Anemy Anemy mentioned this pull request Jul 13, 2021
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.

2 participants