77
88## How to use
99
10- 1 . Extract the queries [ statically] ( #static-extractor ) or [ dynamically] ( #dynamic-extractor )
11- 2 . [ Get your table schema] ( #getting-table-schemas )
12- 3 . [ Generate cache plan] ( #generate-cache-plan )
13- 4 . [ Generate the driver] ( #generate-the-driver )
14- 5 . [ Switch the driver] ( #switch-the-driver )
10+ 1 . [ Install isuc CLI] ( #install-isuc-cli )
11+ 2 . Extract the queries [ statically] ( #static-extractor ) or [ dynamically] ( #dynamic-extractor )
12+ 3 . [ Get your table schema] ( #getting-table-schemas )
13+ 4 . [ Generate cache plan] ( #generate-cache-plan )
14+ 5 . [ Generate the driver] ( #generate-the-driver )
15+ 6 . [ Switch the driver] ( #switch-the-driver )
16+
17+ ### Install isuc CLI
18+
19+ ``` sh
20+ go install github.com/traP-jp/isuc/cli/isuc@latest
21+ ```
1522
1623### Extractor
1724
1825#### Static Extractor
1926
20- <!-- TODO: rewrite for production usage (not need to clone repository) -->
21-
2227- ` --out ` represents the destination file of the extracted queries.
2328 - Set to ` extracted.sql ` by default
2429
2530``` sh
26- go run cli/ * .go extract --out extracted.sql /path/to/your/codebase/dir
31+ isuc extract --out extracted.sql /path/to/your/codebase/dir
2732```
2833
2934#### Dynamic Extractor
@@ -63,10 +68,8 @@ mysql -u "$USER" -p"$PASSWORD" -h "$HOST" -N -e "SHOW TABLES FROM $DATABASE" | w
6368
6469### Generate Cache Plan
6570
66- <!-- TODO: rewrite for production usage (not need to clone repository) -->
67-
6871``` sh
69- go run cli/ * .go analyze --sql extracted.sql --schema schema.sql --out isuc.yaml
72+ isuc analyze --sql extracted.sql --schema schema.sql --out isuc.yaml
7073```
7174
7275- ` --sql ` represents extracted queries (via the static/dynamic extractor)
@@ -78,10 +81,8 @@ go run cli/*.go analyze --sql extracted.sql --schema schema.sql --out isuc.yaml
7881
7982### Generate the driver
8083
81- <!-- TODO: rewrite for production usage (not need to clone repository) -->
82-
8384``` sh
84- go run cli/ * .go generate --plan isuc.yaml --schema schema.sql < dist>
85+ isuc generate --plan isuc.yaml --schema schema.sql < dist>
8586```
8687
8788- ` --plan ` represents generated cache plan
@@ -101,7 +102,6 @@ Rewrite the section of connecting to a database.
101102
102103## Appendix
103104
104-
105105### Cache Plan Format
106106
107107``` ts
0 commit comments