Created
November 14, 2020 23:36
-
-
Save jmrobles/e33a9798d44ba4651045fa64b2ee5e53 to your computer and use it in GitHub Desktop.
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
package main | |
import ( | |
"database/sql" | |
"log" | |
_ "github.com/jmrobles/h2go" | |
) | |
func main() { | |
conn, err := sql.Open("h2", "h2://sa@localhost/testdb?mem=true") | |
if err != nil { | |
log.Fatalf("Can't connet to H2 Database: %s", err) | |
} | |
err = conn.Ping() | |
if err != nil { | |
log.Fatalf("Can't ping to H2 Database: %s", err) | |
} | |
log.Printf("H2 Database connected") | |
conn.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment