Permalink
Browse files

add a sample db

  • Loading branch information...
1 parent 4f03227 commit c00e75e6388b75dd47ac008e6ae107d54ac8b4e4 @yyyc514 committed Nov 17, 2009
Showing with 53 additions and 3 deletions.
  1. +3 −3 sqltest.go
  2. BIN states.db
  3. +50 −0 states.txt
View
@@ -24,23 +24,23 @@ func main() {
if (err != "") {
println(err);
} else {
- defer st.Finalize();
st.Step();
+ st.Finalize();
}
st,err = dbh.Prepare("INSERT INTO foo values (3, 'holy moly')");
if (err != "") {
println(err);
} else {
- defer st.Finalize();
st.Step();
+ st.Finalize();
}
fmt.Printf("%d changes\n", dbh.TotalChanges());
fmt.Printf("last insert id: %d\n", dbh.LastInsertRowID());
- st,err = dbh.Prepare("SELECT * from foo;");
+ st,err = dbh.Prepare("SELECT * from foo limit 5;");
if (err != "") {
println(err);
} else {
View
BIN states.db
Binary file not shown.
View
@@ -0,0 +1,50 @@
+1,Alabama,AL
+2,Alaska,AK
+3,Arizona,AZ
+4,Arkansas,AR
+5,California,CA
+6,Colorado,CO
+7,Connecticut,CT
+8,Delaware,DE
+9,Florida,FL
+10,Georgia,GA
+11,Hawaii,HI
+12,Idaho,ID
+13,Illinois,IL
+14,Indiana,IN
+15,Iowa,IA
+16,Kansas,KS
+17,Kentucky,KY
+18,Louisiana,LA
+19,Maine,ME
+20,Maryland,MD
+21,Massachusetts,MA
+22,Michigan,MI
+23,Minnesota,MN
+24,Mississippi,MS
+25,Missouri,MO
+26,Montana,MT
+27,Nebraska,NE
+28,Nevada,NV
+29,New Hampshire,NH
+30,New Jersey,NJ
+31,New Mexico,NM
+32,New York,NY
+33,North Carolina,NC
+34,North Dakota,ND
+35,Ohio,OH
+36,Oklahoma,OK
+37,Oregon,OR
+38,Pennsylvania,PA
+39,Rhode Island,RI
+40,South Carolina,SC
+41,South Dakota,SD
+42,Tennessee,TN
+43,Texas,TX
+44,Utah,UT
+45,Vermont,VT
+46,Virginia,VA
+47,Washington,WA
+48,West Virginia,WV
+49,Wisconsin,WI
+50,Wyoming,WY

0 comments on commit c00e75e

Please sign in to comment.