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

Official document #90

Merged
merged 15 commits into from
Sep 29, 2022
Merged

Official document #90

merged 15 commits into from
Sep 29, 2022

Conversation

oscar60310
Copy link
Contributor

@oscar60310 oscar60310 commented Sep 25, 2022

Description

Use nx start doc to start document server.

Issue ticket number

closes #52

Additional Context

@codecov-commenter
Copy link

Codecov Report

Base: 92.60% // Head: 92.60% // No change to project coverage 👍

Coverage data is based on head (2010620) compared to base (4cbc840).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #90   +/-   ##
========================================
  Coverage    92.60%   92.60%           
========================================
  Files          259      259           
  Lines         3798     3798           
  Branches       481      481           
========================================
  Hits          3517     3517           
  Misses         185      185           
  Partials        96       96           
Flag Coverage Δ
build 94.90% <ø> (ø)
cli 89.38% <ø> (ø)
core 92.99% <ø> (ø)
extension-dbt 97.43% <ø> (ø)
extension-debug-tools 98.11% <ø> (ø)
extension-driver-duckdb 100.00% <ø> (ø)
extension-driver-pg 94.87% <ø> (ø)
integration-testing 96.15% <ø> (ø)
serve 90.38% <ø> (ø)
test-utility ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vercel
Copy link

vercel bot commented Sep 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vulcan-sql-document ✅ Ready (Inspect) Visit Preview Sep 29, 2022 at 2:49AM (UTC)

the first version of our official document

Co-authored-by: JSYOU <Star2ver.Dev@gmail.com>
Co-authored-by: Yi-Cheng Kuo <v6610688@gmail.com>
Copy link
Contributor

@kokokuo kokokuo left a comment

Choose a reason for hiding this comment

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

Only a little typo and suggestions, others LGTM 👍
Thanks so much for building the doc server and uploading documents to here.


```sql
{% req user %}
SELECT COUNT(\*) AS count FROM customers
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it should be COUNT(*)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll fix it.

LIMIT 1
```

We used the if expression to throw an error when the result equals `0`, VulcanSQL server will stop executing and respond immediately when meeting a {% error %} tag, `"CUSTOMER_NOT_FOUND"` is the error code we want to throw.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the quote to be {% error %} ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure


```sql
{% req user %}
SELECT COUNT(\*) AS count FROM customers
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it should be COUNT(*)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll fix it.

LIMIT 1
```

{% set %} tag saved the result from the right side like most programming languages: `var someVar = someVal`, in this example, we saved the query result into `userCount` variable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the quote to be {% set %} ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

[{"arr":"1,2,3,4,4"}]%
```

Otherwise, you will see the above example always print the value to `$[number]` e.g: `$1` and then print the value in the terminal and display the `$1` as key and then shows the value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you assist me to change the $[number] to $<number> ?


### Raw Filter

The `raw` filter is the VulcanSQL custom filer function, which could make your defined variable or dynamic parameter output value directly, it will transform `$[number]` to the value first and if you still have a pipe function after the `raw` , then it will use the output value to do the filter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as here, could you assist me to change the $[number] to $<number>, thanks ?


We use `default` filter here to set the fallback value. When users don't send the parameter, we use a default value.

Unlike the last API, we use {% if %} expression the determine whether render the SQL or not, the queries in if blocks are only sent when the condition is satisfied.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the quote to be {% if %} ?

@@ -0,0 +1,323 @@
# Configuration

When using the VulcanSQL and creating the project through `vulcan init`, you will see a file named `vulcan.yaml` under the project root.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
When using the VulcanSQL and creating the project through `vulcan init`, you will see a file named `vulcan.yaml` under the project root.
After creating a VulcanSQL project by `vulcan init`, you will see a file named `vulcan.yaml` under the project root.


# Filename of Project Config

Although the `vulcan.yaml` is the VulcanSQL project config name, but it is not mandatory actually. You could rename the project config file, but VulcanSQL will default use it when you play our command e.g: `vulcan build`, `vulcan serve`, or `vulcan start`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Although the `vulcan.yaml` is the VulcanSQL project config name, but it is not mandatory actually. You could rename the project config file, but VulcanSQL will default use it when you play our command e.g: `vulcan build`, `vulcan serve`, or `vulcan start`.
Although we said that the `vulcan.yaml` is the VulcanSQL project config name, but it is not mandatory actually. You could rename the project config file, but VulcanSQL will default use it when you play our command e.g: `vulcan build`, `vulcan serve`, or `vulcan start`.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks so much for modifying it!

Comment on lines 74 to 80
In the VulcanSQL project config, we will provide a section for you to define the project `name` and give the `description` for recording it so you or your partner could know the project's purpose. The `version` will record what VulcanSQL version you used, basically your installed version.

```yaml
name: my-first-vulcan-project
description: A starter VulcanSQL project
version: 0.2.0
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The version in config is the version of their project, which is controlled by uses. It has no relation with VulcanSQL~

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks so much for pointing it out.

document-generator:
specs:
- oas3
folderPath: .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've removed this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean folderPath option only or all of document-generator ?

It is the folderPath, yes this is my misunderstanding, thanks so much.
If you mean all of document-generator, it still exists in the vulcan.yaml template of the cli package.

Comment on lines 222 to 223
Otherwise, VulcanSQL also has some external extensions which we have prepared, so if you would like to use external extensions, you could follow the below structure to define:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Otherwise, VulcanSQL also has some external extensions which we have prepared, so if you would like to use external extensions, you could follow the below structure to define:
VulcanSQL had created some external extensions, if you would like to use these extensions, you could follow the below structure to define them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks so much for modifying it!

`enabled`

- `default: true`
- `typt: boolean`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
- `typt: boolean`
- `type: boolean`


```sql
{% req user %}
SELECT COUNT(\*) AS count FROM customers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll fix it.

LIMIT 1
```

We used the if expression to throw an error when the result equals `0`, VulcanSQL server will stop executing and respond immediately when meeting a {% error %} tag, `"CUSTOMER_NOT_FOUND"` is the error code we want to throw.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure


```sql
{% req user %}
SELECT COUNT(\*) AS count FROM customers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll fix it.

LIMIT 1
```

{% set %} tag saved the result from the right side like most programming languages: `var someVar = someVal`, in this example, we saved the query result into `userCount` variable.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@oscar60310 oscar60310 changed the title [WIP] Official document Official document Sep 29, 2022
@oscar60310 oscar60310 marked this pull request as ready for review September 29, 2022 03:03
@oscar60310 oscar60310 merged commit 65413b8 into develop Sep 29, 2022
@oscar60310 oscar60310 deleted the feature/init-document branch September 29, 2022 03:04
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.

Update our official documentation
4 participants