feat: add MySQL reader and writer

This commit is contained in:
SG Command
2026-10-03 12:36:39 +02:00
parent b38f53c603
commit 7a9219b6e3
53 changed files with 12311 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package mysql
import (
"git.warky.dev/wdevs/relspecgo/pkg/readers"
"testing"
)
func TestReaderMapDataType(t *testing.T) {
r := NewReader(&readers.ReaderOptions{})
for _, tc := range []struct{ input, want string }{{"varchar(64)", "string"}, {"bigint unsigned", "int64"}, {"datetime", "timestamp"}, {"json", "json"}} {
if got := r.mapDataType(tc.input); got != tc.want {
t.Errorf("mapDataType(%q) = %q, want %q", tc.input, got, tc.want)
}
}
}
func TestReaderRequiresConnectionString(t *testing.T) {
if _, err := NewReader(&readers.ReaderOptions{}).ReadDatabase(); err == nil {
t.Fatal("expected missing connection string error")
}
}