Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flimzy/go-sql.js
GopherJS bindings for SQL.js
https://github.com/flimzy/go-sql.js
database gopherjs gopherjs-bindings sqlite3
Last synced: 6 days ago
JSON representation
GopherJS bindings for SQL.js
- Host: GitHub
- URL: https://github.com/flimzy/go-sql.js
- Owner: flimzy
- License: mit
- Created: 2016-05-29T14:35:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T00:58:30.000Z (over 7 years ago)
- Last Synced: 2024-12-15T11:49:37.645Z (10 days ago)
- Topics: database, gopherjs, gopherjs-bindings, sqlite3
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/flimzy/go-sql.js.svg?branch=master)](https://travis-ci.org/flimzy/go-sql.js) [![GoDoc](https://godoc.org/github.com/flimzy/go-sql.js?status.png)](http://godoc.org/github.com/flimzy/go-sql.js)
This package provides [GopherJS](http://www.gopherjs.org/) bindings around [SQL.js](https://github.com/kripken/sql.js), and a [database/sql/driver](https://golang.org/pkg/database/sql/driver/) implementation, for use with the standard Go Database driver infrastructure.
SQL.js is SQLite compiled to JavaScript through Emscripten, which can run in the browser. If your goal is to use SQLite from Go, you should use [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) or [go-sqlite](https://github.com/mxk/go-sqlite) instead. If your intention is to use SQLite within GopherJS running on node.js, you should probably use the [sqlite3](https://www.npmjs.com/package/sqlite3) package instead (which as far as I know, has no GopherJS bindings at the moment).
To be clear: You should only use this package if you are writing code for GopherJS which must run in the browser.
This does not support storing databases on the filesystem--it only supports in-memory databases (which may be imported from binary blobs). The database/sql driver also does not support transactions (what value would they be in an in-memory, in-browser database, anyway?)
Build instructions
------------------
As this package provides bindings for a JavaScript package, naturally the JavaScript must be installed to successfully use these bindings. In your GopherJS package, which depends on this one, you can add a `package.json` which includes `sql.js` as a dependency, then run `npm install` prior to building the GopherJS package.