bizare...
[goDBhammer.git] / src / dbibridge.go.or
1 package dbibridge
2
3 // #include <stdio.h>
4 // #include <dbi/dbi.h>
5 import "C"
6
7 import (
8         "unsafe";
9 )
10
11 func dbiconnect()
12 {
13         
14         C.dbi_initialize(nil);
15         
16         myVar := C.dbi_conn_new(C.CString("mysql"));
17         
18         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("host"), C.CString("localhost"));
19         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("username"), C.CString("your_name"));
20         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("username"), C.CString("your_name"));
21         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("password"), C.CString("your_password"));
22         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("dbname"), C.CString("your_dbname"));
23         C.dbi_conn_set_option((unsafe.Pointer)(myVar), C.CString("encoding"), C.CString("UTF-8"));
24         C.dbi_conn_connect((unsafe.Pointer)(myVar));
25         
26         
27          
28 }