-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WORK IN PROGRESS
- Loading branch information
Showing
10 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ _testmain.go | |
.env | ||
/testfixtures | ||
/dist | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// +build mysql | ||
|
||
package testfixtures | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
_ "github.com/go-sql-driver/mysql" | ||
) | ||
|
||
func TestClickHouse(t *testing.T) { | ||
testLoader( | ||
t, | ||
"clickhouse", | ||
os.Getenv("CLICKHOUSE_CONN_STRING"), | ||
"testdata/schema/clickhouse.sql", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
DROP TABLE IF EXISTS votes; | ||
DROP TABLE IF EXISTS comments; | ||
DROP TABLE IF EXISTS posts_tags; | ||
DROP TABLE IF EXISTS posts; | ||
DROP TABLE IF EXISTS tags; | ||
DROP TABLE IF EXISTS users; | ||
|
||
CREATE TABLE posts | ||
( | ||
id UInt64, | ||
title String, | ||
content String, | ||
created_at DateTime DEFAULT '2000-01-01 00:00:00', | ||
updated_at DateTime DEFAULT '2000-01-01 00:00:00' | ||
) ENGINE MergeTree ORDER BY created_at; | ||
|
||
CREATE TABLE tags | ||
( | ||
id UInt64, | ||
name String, | ||
created_at DateTime DEFAULT '2000-01-01 00:00:00', | ||
updated_at DateTime DEFAULT '2000-01-01 00:00:00' | ||
) ENGINE MergeTree ORDER BY created_at; | ||
|
||
CREATE TABLE posts_tags | ||
( | ||
post_id UInt64, | ||
tag_id UInt64, | ||
created_at DateTime DEFAULT now() | ||
) ENGINE MergeTree ORDER BY created_at; | ||
|
||
CREATE TABLE comments | ||
( | ||
id UInt64, | ||
post_id UInt64, | ||
author_name String, | ||
author_email String, | ||
content String, | ||
created_at DateTime DEFAULT '2000-01-01 00:00:00', | ||
updated_at DateTime DEFAULT '2000-01-01 00:00:00' | ||
) ENGINE MergeTree ORDER BY created_at; | ||
|
||
CREATE TABLE votes | ||
( | ||
id UInt64, | ||
comment_id UInt64, | ||
created_at DateTime DEFAULT '2000-01-01 00:00:00', | ||
updated_at DateTime DEFAULT '2000-01-01 00:00:00' | ||
) ENGINE MergeTree ORDER BY created_at; | ||
|
||
CREATE TABLE users | ||
( | ||
id UInt64, | ||
attributes String, | ||
created_at DateTime DEFAULT now() | ||
) ENGINE MergeTree ORDER BY created_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"database/sql" | ||
"fmt" | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
"testing" | ||
"time" | ||
|