SQLite

SQLite is a convenient way of implementing a simple database in Unity. Rather than a full-blown client-server based implementation of SQL, SQLite uses a single local file to store the database, and provides access to that file via standard SQL commands.

Advantages of SQLite:
 * Easy setup in Javascript
 * Easy to view database structure and contents with the free SQLite Browser
 * Maintains state over sessions (since it's a local file)

Disadvantages of SQLite:
 * Since it's using a local file for the database, it is NOT possible to use it for Web Player applications
 * It's a bit finicky to get set up with in C#
 * (Advanced) It's doesn't guarantee domain integrity - not usually a problem, since Unity's single threaded nature makes it probably impossible to write two things at the same time, but you might have issues if you're trying to write to your database from a program outside of Unity at the same time.

So how do you set it up, and how do you start working with SQLite in Unity? For now, this guide only focuses on Javascript, since it's easier to set up. And as long as your database-access functions return acceptable types, you can access all the Javascript functions from C# or Boo so long as you put your database scripts in the 'Plugins' or 'Standard Assets' folder of your project, and don't try to access them by scripts that are earlier in the compiler order

JavaScript
Here are the specific steps to getting SQLite set up in your project.
 * 1) Download SQLite - you'll want the ZIP file with the DLL inside that's in the Precompiled Binaries for Windows section.
 * 2) Important Copy sqlite3.dll into your into your project's Plugins folder (make a folder called Plugins if you don't have one).
 * 3) * You won't get a warning if you don't do this, and your project will run fine in the editor, however, it will fail to work when you actually build your project, and will only provide information about this in the log file.
 * 4) * This will give you a License Error if you're using Unity Indie, but it doesn't seem to have an effect on the actual play in the editor, nor does it seem to effect the ability to build stand-alone versions.
 * 5) * Alternately, you can leave it out of your project entirely, but when you build your application, you'll need to include a copy of sqlite3.dll in the same directory as the .exe in order for it to work.
 * 6) In your project, add in the dbAccess.js file below.
 * 7) You should be good to go!  An example using the database is also included - ScriptThatUsesTheDatabase.js - It is a GUI script, so attach it to your main camera.
 * 8) The commands run by the dbAccess class are IDbCommand commands, and those commands return an IDataReader object. For more information on using those interfaces, the references are here:   IDbCommand and IDataReader

Troubleshooting

 * 1) Everything works fine in the editor, but when I make a build, my SQL stuff doesn't work.
 * 2) * For whatever reason, the sqlite3.dll file needs to be in the Plugins directory of your project.