-
Notifications
You must be signed in to change notification settings - Fork 32
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
Feature: Passing route information to template engine #142
Feature: Passing route information to template engine #142
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8219365
to
c1bdea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides some suggestions Others LGTM 👍
packages/core/src/lib/template-engine/nunjucksExecutionMetadata.ts
Outdated
Show resolved
Hide resolved
...... | ||
``` | ||
|
||
For more available parameters, please refer to: [Koajs#Request](https://koajs.com/#request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another suggestion is that a sample for using sample
in the api schema file, because if user would like to make the build time work with sample, he should also add the req
to sample:
-- We use the req in sql file
select
*,
{{ context.req.method }} as "req-method",
{{ context.req.url }} as "req-url"
from "artists"
where
ConstituentID = {{ context.params.id }}
and
{{ context.req.method }} = 'GET'
# API Schema
urlPath: /artist/:id
request:
- fieldName: id
fieldIn: path
description: constituent id
validators:
- required
sample:
req:
method: GET
url: 'localhost:3000'
parameters:
id: '1'
profile: duck
profile: duck
``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @kokokuo , I found that there is already a section about set-sampler in the document. Maybe we can update this section to inform the user on how to properly configure it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you open an issue to record the improvement content ? cc @JSYOU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could update the Otherwise, I think we could also update the package version to {
"name": "my-first-vulcan-project",
"dependencies": {
"@vulcan-sql/core": "0.3.1-dev.20230205.0",
"@vulcan-sql/extension-driver-duckdb": "0.3.1-dev.20230205.0",
"@vulcan-sql/serve": "0.3.1-dev.20230205.0"
},
"devDependencies": {
"@vulcan-sql/build": "0.3.1-dev.20230205.0"
}
}
Thanks so much! |
Since it's possible users will just copy our example code in |
Sure, we could change the stable version But actually, we also provide the vulcan-demo to users for playing, and the |
Codecov ReportBase: 93.03% // Head: 92.97% // Decreases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## develop #142 +/- ##
===========================================
- Coverage 93.03% 92.97% -0.07%
===========================================
Files 289 289
Lines 4393 4398 +5
Branches 580 582 +2
===========================================
+ Hits 4087 4089 +2
- Misses 199 200 +1
- Partials 107 109 +2
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Description
The route information like host, path ...etc. are useful while rendering SQL queries.
Issue ticket number
closes #62
Additional Context