mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
24 lines
363 B
Go
24 lines
363 B
Go
package helper
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestPostgreSQL(t *testing.T) {
|
|
post, err := PostgreSQL{}.Create("192.168.0.14", 5432, "postgres", "123", "test")
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
rows, err := post.Query("select * from table1")
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
defer rows.Close()
|
|
|
|
for rows.Next() {
|
|
t.Log(rows.Values())
|
|
}
|
|
}
|