Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
43 lines (35 loc) · 978 Bytes

File metadata and controls

43 lines (35 loc) · 978 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package codegen
import (
"fmt"
"github.com/spf13/cobra"
"github.com/streamingfast/cli/sflags"
)
var SQLCmd = &cobra.Command{
Use: "sql [<manifest_url>]",
Short: "Generate sql extension from substreams manifest",
Args: cobra.RangeArgs(0, 1),
RunE: generateSQLEnv,
}
func generateSQLEnv(cmd *cobra.Command, args []string) error {
manifestPath := ""
if len(args) == 1 {
manifestPath = args[0]
}
withDevEnv := sflags.MustGetBool(cmd, "with-dev-env")
err := buildGenerateCommandFromArgs(manifestPath, Sql, withDevEnv)
if err != nil {
return fmt.Errorf("building generate command: %w", err)
}
input := fmt.Sprintf(
"Your Substreams SQL Extension is now generated!\n\n" +
"**Now follow the next steps:**\n\n" +
"Open the sql directory:\n\n" +
"`cd sql`\n\n" +
"Build the substreams package:\n\n" +
"`substreams build`\n\n" +
"Sink data into your database:\n\n" +
"`substreams-sink-sql`\n\n",
)
printMarkdown(input)
return nil
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.