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

feat: Add bun #5

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions example/bun/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

wd=$(pwd)

# generate create code
cd "$wd/create"
rm -rf "user_*.go"
sqlgen bun -f "example.sql" -o .

# generate delete code
cd "$wd/delete"
rm -rf "user_*.go"
sqlgen bun -f "example.sql" -o .

# generate read code
cd "$wd/read"
rm -rf "user_*.go"
sqlgen bun -f "example.sql" -o .

# generate update code
cd "$wd/update"
rm -rf "user_*.go"
sqlgen bun -f "example.sql" -o .

cd "$wd"

# go mod tidy
go mod tidy

go test ./...
52 changes: 52 additions & 0 deletions example/bun/create/user_model.gen.go

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

8 changes: 8 additions & 0 deletions example/bun/create/user_model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package model

import "context"

// TODO(sqlgen): Add your own customize code here.
func (m *UserModel) Customize(ctx context.Context, args ...any) {

}
128 changes: 128 additions & 0 deletions example/bun/delete/user_model.gen.go

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

8 changes: 8 additions & 0 deletions example/bun/delete/user_model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package model

import "context"

// TODO(sqlgen): Add your own customize code here.
func (m *UserModel) Customize(ctx context.Context, args ...any) {

}
Loading