Skip to content

Commit

Permalink
fix: Use go embed
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfreak committed Aug 13, 2024
1 parent 74c119c commit 3cebe68
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 44 deletions.
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ watch:
wait
# SQL Watcher done

# Puts the schema in a constant in go so it can be used to create the table directly
schema-const:
echo "// Code generated by Makefile. DO NOT EDIT." > internal/schema.go
echo "package internal\n" >> internal/schema.go
echo "const Schema = \`" >> internal/schema.go
cat db/schema.sql >> internal/schema.go
echo "\`" >> internal/schema.go


.PHONY: bench
bench:
make cleanup
Expand Down
2 changes: 1 addition & 1 deletion internal/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions internal/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 3 additions & 28 deletions internal/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sqlc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "2"
sql:
- engine: "sqlite"
queries: "db/queries.sql"
schema: "db/schema.sql"
queries: "internal/db/queries.sql"
schema: "internal/db/schema.sql"
gen:
go:
package: "internal"
Expand Down

0 comments on commit 3cebe68

Please sign in to comment.