Skip to content

Commit

Permalink
fix: fix check error
Browse files Browse the repository at this point in the history
  • Loading branch information
Breeze0806 committed Oct 5, 2024
1 parent de47f30 commit b6bcf6d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
1 change: 1 addition & 0 deletions README_USER.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ datax -c examples/postgresxlsx/config.json
* Before use, download the corresponding [SQLite Download Page](https://www.sqlite.org/download.html).
* Note: On Windows, set `path=%path%;/opt/sqlite/sqlite3.dll`.
* Initialize the database using `cmd/datax/examples/sqlite3/init.sql` **for testing purposes**
* In `examples/sqlite3/config.json`, `url` is the path of sqlite3 database files. On Windows, it can be `E:\sqlite3\test.db`, meanwhile, on Linux, it can be `/sqlite3/test.db`,
* Start the sqlite3 synchronization command:

```bash
Expand Down
1 change: 1 addition & 0 deletions README_USER_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ datax -c examples/postgresxlsx/config.json
* 在使用前,请下载相应的[SQLite驱动](https://www.sqlite.org/download.html).
* 注意:在 Windows 系统上,设置 `path=%path%;/opt/sqlite/sqlite3.dll`
* 使用 `cmd/datax/examples/sqlite3/init.sql` **用于测试目的** 初始化数据库
*`examples/sqlite3/config.json` 文件中,`url` 表示 sqlite3 数据库文件的路径。在 Windows 系统上,它可以是 `E:\sqlite3\test.db`,而在 Linux 系统上,它可以是 `/sqlite3/test.db`
* 启动 sqlite3 同步命令:

##### 2.1.2.11 其他同步例子
Expand Down
11 changes: 6 additions & 5 deletions storage/database/sqlite3/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package sqlite3_test
import (
"context"
"fmt"
"testing"

"github.com/Breeze0806/go-etl/config"
"github.com/Breeze0806/go-etl/element"
Expand Down Expand Up @@ -63,15 +62,17 @@ func (f *FetchHandler) CreateRecord() (element.Record, error) {
return element.NewDefaultRecord(), nil
}

func ExampleSqlite3(t *testing.T) {
t.Log("strat")
func Example_sqlite3() {
fmt.Println("strat")
db, err := database.Open("sqlite3", testJSONFromString(`{"url":"E:\\projects\\sqlite3\\test.db"}`))
if err != nil {
t.Errorf("open fail. err: %v", err)
fmt.Printf("open fail. err: %v", err)
return
}
defer db.Close()
err = db.FetchRecord(context.TODO(), NewTableParam(), &FetchHandler{})
if err != nil {
t.Errorf("fetchRecord fail. err: %v", err)
fmt.Printf("fetchRecord fail. err: %v", err)
return
}
}
12 changes: 0 additions & 12 deletions storage/database/sqlite3/table_test.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
// Copyright 2020 the go-etl Authors.

//

// Licensed under the Apache License, Version 2.0 (the "License");

// you may not use this file except in compliance with the License.

// You may obtain a copy of the License at

//

// http://www.apache.org/licenses/LICENSE-2.0

//

// Unless required by applicable law or agreed to in writing, software

// distributed under the License is distributed on an "AS IS" BASIS,

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

// See the License for the specific language governing permissions and

// limitations under the License.

package sqlite3
Expand Down

0 comments on commit b6bcf6d

Please sign in to comment.