Skip to content

Commit 3159e66

Browse files
authored
update instructions (#101)
1 parent 4743948 commit 3159e66

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ The `sqlds` package is intended to remove the repetition of these datasources an
1111
**Usage**
1212

1313
```go
14-
ds := sqlds.NewDatasource(&myDatasource{})
15-
if err := datasource.Manage("my-datasource", ds.NewDatasource, datasource.ManageOpts{}); err != nil {
14+
if err := datasource.Manage("my-datasource", datasourceFactory, datasource.ManageOpts{}); err != nil {
1615
log.DefaultLogger.Error(err.Error())
1716
os.Exit(1)
1817
}
18+
19+
func datasourceFactory(s backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
20+
ds := sqlds.NewDatasource(&myDatasource{})
21+
return ds.NewDatasource(s)
22+
}
1923
```
2024

2125
## Standardization

0 commit comments

Comments
 (0)