Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit Shani authored Oct 20, 2021
1 parent 8bb0785 commit 28dc011
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,20 @@ go install ariga.io/sqlcomment

# Basic Usage
```go
import (
"ariga.io/sqlcomment"
"entgo.io/ent/dialect/sql"
)
// Create db driver.
db, err := sql.Open("sqlite3", "file:ent?mode=memory&cache=shared&_fk=1")
if err != nil {
log.Fatalf("Failed to connect to database: %v", err)
}
// create sqlcomment driver which wraps sqlite driver.
// Create sqlcomment driver which wraps sqlite driver.
drv := sqlcomment.NewDriver(db,
sqlcomment.WithDriverVerTag(),
sqlcomment.WithTags(sqlcomment.Tags{
sqlcomment.KeyApplication: "my-app",
sqlcomment.KeyFramework: "net/http",
}),
)
// create and configure ent client
// Create and configure ent client
client := ent.NewClient(ent.Driver(drv))
```

Expand All @@ -41,4 +37,4 @@ middleware := func(next http.Handler) http.Handler {
}
return http.HandlerFunc(fn)
}
```
```

0 comments on commit 28dc011

Please sign in to comment.