Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Unit Tests
run: |
mkdir -p build
go test -gcflags=all=-l ./pkg/... -coverprofile=coverage.txt -covermode=atomic
go test -gcflags=all=-l $(go list ./... | grep -v /test/ | grep -v /parser | grep -v /types | grep -v /bucketpool) -coverprofile=coverage.txt -covermode=atomic

- name: Post Coverage
run: bash <(curl -s https://codecov.io/bash)
Expand Down
4 changes: 2 additions & 2 deletions docker/conf/config_rws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql1:3306)/employees?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql1:3306)/?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand All @@ -50,7 +50,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql2:3306)/employees?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql2:3306)/?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3

Expand Down
2 changes: 1 addition & 1 deletion docker/conf/config_sdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql:3306)/employees?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql:3306)/?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand Down
5 changes: 2 additions & 3 deletions docker/conf/config_shd_mod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ app_config:
type: snowflake
config:
worker_id: 123
# dsn: root:123456@tcp(dbpack-mysql1:3306)/world?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
topology:
"0": 0-4
"1": 5-9
Expand All @@ -68,7 +67,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql1:3306)/world?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql1:3306)/?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand All @@ -78,7 +77,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql2:3306)/world?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql2:3306)/?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand Down
5 changes: 2 additions & 3 deletions docker/conf/config_shd_range.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ app_config:
type: snowflake
config:
worker_id: 123
# dsn: root:123456@tcp(dbpack-mysql1:3306)/world?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
topology:
"0": 0-4
"1": 5-9
Expand All @@ -79,7 +78,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql1:3306)/world?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql1:3306)/?timeout=10s&readTimeout=10s&writeTimeout=10s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand All @@ -89,7 +88,7 @@ app_config:
capacity: 10
max_capacity: 20
idle_timeout: 60s
dsn: root:123456@tcp(dbpack-mysql2:3306)/world?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
dsn: root:123456@tcp(dbpack-mysql2:3306)/?timeout=60s&readTimeout=60s&writeTimeout=60s&parseTime=true&loc=Local&charset=utf8mb4,utf8
ping_interval: 20s
ping_times_for_change_status: 3
filters:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-rws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ services:

networks:
local:
name: dbpack
name: dbpack-network
2 changes: 1 addition & 1 deletion docker/docker-compose-sdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ services:
command: ["./wait-for-mysql.sh","--","/dbpack", "start", "-c", "config.yaml"]
networks:
local:
name: dbpack
name: dbpack-network
2 changes: 1 addition & 1 deletion docker/docker-compose-shd-mod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ services:
command: ["./wait-for-mysql.sh","--","/dbpack", "start", "-c", "mod_config.yaml"]
networks:
local:
name: dbpack
name: dbpack-network
2 changes: 1 addition & 1 deletion docker/docker-compose-shd-range.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ services:
command: ["./wait-for-mysql.sh","--","/dbpack", "start", "-c", "range_config.yaml"]
networks:
local:
name: dbpack
name: dbpack-network
29 changes: 17 additions & 12 deletions docker/scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@ CREATE TABLE salaries (
PRIMARY KEY (`id`)
);

CREATE TABLE `undo_log` (
`id` bigint NOT NULL AUTO_INCREMENT,
`branch_id` bigint NOT NULL,
`xid` varchar(100) NOT NULL,
`context` varchar(128) NOT NULL,
`rollback_info` longblob NOT NULL,
`log_status` int NOT NULL,
`log_created` datetime NOT NULL,
`log_modified` datetime NOT NULL,
`ext` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
);

CREATE OR REPLACE VIEW dept_emp_latest_date AS
SELECT emp_no, MAX(from_date) AS from_date, MAX(to_date) AS to_date
Expand All @@ -117,3 +105,20 @@ CREATE OR REPLACE VIEW current_dept_emp AS
FROM dept_emp d
INNER JOIN dept_emp_latest_date l
ON d.emp_no=l.emp_no AND d.from_date=l.from_date AND l.to_date = d.to_date;

DROP DATABASE IF EXISTS meta;
CREATE DATABASE IF NOT EXISTS meta;
USE meta;

CREATE TABLE `undo_log` (
`id` bigint NOT NULL AUTO_INCREMENT,
`branch_id` bigint NOT NULL,
`xid` varchar(100) NOT NULL,
`context` varchar(128) NOT NULL,
`rollback_info` longblob NOT NULL,
`log_status` int NOT NULL,
`log_created` datetime NOT NULL,
`log_modified` datetime NOT NULL,
`ext` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
);
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/cectc/dbpack

go 1.23
go 1.23.0

toolchain go1.23.2

require (
github.com/agiledragon/gomonkey/v2 v2.7.0
Expand Down Expand Up @@ -42,6 +44,7 @@ require (
go.uber.org/goleak v1.1.12
go.uber.org/ratelimit v0.2.1-0.20220713224938-b62b799bc9a5
go.uber.org/zap v1.21.0
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
golang.org/x/net v0.25.0
golang.org/x/text v0.21.0
google.golang.org/grpc v1.56.3
Expand Down Expand Up @@ -144,7 +147,7 @@ require (
go.opentelemetry.io/otel/sdk v1.9.0
go.opentelemetry.io/otel/trace v1.9.0
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/sync v0.10.0
golang.org/x/sync v0.14.0
golang.org/x/sys v0.28.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
Expand Down
Loading
Loading