srhea / scalaqlite Goto Github PK
View Code? Open in Web Editor NEWA native Scala library for using Sqlite3
Home Page: http://srhea.net/
License: MIT License
A native Scala library for using Sqlite3
Home Page: http://srhea.net/
License: MIT License
scalaqlite - A native Scala library for using Sqlite3 I recently wanted to use Sqlite from within Scala for a little project I'm working on, and I couldn't find any Scala libraries for doing so. There are Java libraries out there, but they're all very Java-ish, and I'm not crazy about Java. This library is intended to give a very Scala-ish interface to Sqlite. For example, you can use the follwing code to print all the rows in table "foo" with the columns separated by spaces: for (row <- db.query("SELECT * FROM foo;")) println(row.map(_.toString).mkString(" ")) Or if you want to add up the values of the first column, you can do this: for (row <- db.query("SELECT * FROM foo;")) { row(0) match { case SqlInt(i) => sum += i case _ => throw new Exception("expected an int") } } I'm pretty new to Scala, and I haven't written much Java in the last few years, so this library is definitely a work in progress. Please send constructive feedback, and please be tolerant of interface changes as the library matures. Note that sbt doesn't handle setting java.library.path yet, so you have to run the tests like this: LD_LIBRARY_PATH=./target/native sbt test If you want to avoid compiling the native code and setting LD_LIBRARY_PATH, at the cost of some performance, check out the jna branch. Sean
this implies upgrading ScalaTest to "1.9.1"
Even a snapshot would be good.
The JNA branch is probably the best one to be publishing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.