This file contains hidden or 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
| Testing godb ( https://github.com/samonzeweb/godb ) on MS Windows | |
| (cgo/gcc related to github.com/mattn/go-sqlite3) | |
| Source : https://github.com/mattn/go-sqlite3/issues/212#issuecomment-185036480 | |
| Install MSYS2 (64 bits) | |
| - http://www.msys2.org/ | |
| - https://github.com/msys2/msys2/wiki/MSYS2-installation |
This file contains hidden or 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
| #!/bin/bash | |
| docker run --name mariadb -e 'MYSQL_ROOT_PASSWORD=NotSoStr0ngPassword' -p 3306:3306 -d mariadb:latest | |
| sleep 10 | |
| docker exec -it mariadb mysql -uroot -pNotSoStr0ngPassword -hlocalhost -e "create database godb;" | |
| # See https://github.com/go-sql-driver/mysql#dsn-data-source-name | |
| GODB_MYSQL="root:NotSoStr0ngPassword@/godb?parseTime=true" go test |
This file contains hidden or 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
| #!/bin/bash | |
| # Testing godb ( https://github.com/samonzeweb/godb ) with PostgreSQL | |
| docker run --name postgresql -e 'POSTGRES_PASSWORD=NotSoStr0ngPassword' -p 5432:5432 -d postgres:latest | |
| sleep 5 | |
| # See https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters | |
| GODB_POSTGRESQL="postgres://postgres:NotSoStr0ngPassword@localhost/postgres?sslmode=disable" go test |
This file contains hidden or 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
| #!/bin/bash | |
| # Testing godb ( https://github.com/samonzeweb/godb ) with SQL Server on OSX / Linux | |
| docker run --name sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=NotSoStr0ngP@ssword' -p 1433:1433 -d microsoft/mssql-server-linux:latest | |
| docker exec -i sqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P NotSoStr0ngP@ssword <<-EOF | |
| create database godb; | |
| go | |
| exit |
This file contains hidden or 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
| // problem : the placeholder '?' could be changed by ToSQL() ! | |
| query, args, err := db.SelectFrom("noeud").Columns("id").Where("identifiant like ?", "00%").ToSQL() | |
| ... | |
| nodes := make([]Noeud, 0, 0) | |
| err = db.Select(&nodes).Where("id in ("+query+")", args...).Do() | |
| ... | |
NewerOlder