1- A Go library for accessing and using SQLite databases on DBHub.io
1+ [ ![ GoDoc] ( https://godoc.org/github.com/sqlitebrowser/go-dbhub?status.svg )] ( https://godoc.org/github.com/sqlitebrowser/go-dbhub )
2+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/sqlitebrowser/go-dbhub )] ( https://goreportcard.com/report/github.com/sqlitebrowser/go-dbhub )
3+
4+ A Go library for accessing and using SQLite databases stored remotely on DBHub.io
25
36* This is an early stage work in progress*
47
58What works now:
69
7- * Running any read-only query (eg SELECT statements) on databases, returning the results
8- * Listing the tables, views, indexes, and columns present in a database
10+ * Run read-only queries (eg SELECT statements) on databases, returning the results as JSON
11+ * List the names of tables, views, and indexes present in a database
12+ * List the columns present in a table or view, along with their details
13+
14+ Still to do:
15+
16+ * Tests for each function
17+ * Retrieve index details for a database
18+ * Return the list of available databases
19+ * Download a complete database
20+ * Upload a complete database
21+ * Retrieve database commit history details (size, branch, commit list, whatever else is useful)
922
1023Example code:
1124
@@ -27,6 +40,18 @@ fmt.Println("Tables:")
2740for _, j := range tables {
2841 fmt.Printf(" * %s\n", j)
2942}
43+
44+ // Run a SQL query on the remote database
45+ r, err := db.Query("justinclift", "Join Testing.sqlite", false,
46+ `SELECT table1.Name, table2.value
47+ FROM table1 JOIN table2
48+ USING (id)
49+ ORDER BY table1.id`)
50+ if err != nil {
51+ log.Fatal(err)
52+ }
53+ fmt.Printf("Query results:\n\t%v\n", r)
54+ fmt.Println()
3055```
3156
3257Output:
@@ -35,6 +60,9 @@ Output:
3560Tables:
3661 * table1
3762 * table2
63+
64+ Query results:
65+ {[{[Foo 5]} {[Bar 10]} {[Baz 15]} {[Blumph 12.5000]} {[Blargo 8]} {[Batty 3]}]}
3866```
3967
40- Please try it out, and report any weirdness or bugs you encounter. :smile :
68+ Please try it out, submits PRs, and report any weirdness or bugs you encounter. :smile :
0 commit comments