How do I "install" SQLite on my student domain? - sqlite

I've played around with SQLite on my Windows desktop before, but I've never used it in a web context and their web documentation is maddenigly unspecific about things like this. Essentially, I have free student webspace from my school (a /public/html/ directory) and I'd like to use it for a small data-driven web project. SQLite is my only (free) option and I'm wondering how to... "install" it in this context? More specifically, is it safe just to throw the files in the html directory and call it a day?
If it helps, I'm pretty sure it's Linux environment (they run Apache).

See if it's already installed. Try the following in a bash session:
touch test.db
sqlite3 test.db
If not, you'll have to download and install sqlite3.
Useful tip: if you've been trying to run the 'sqlite' binary, it probably doesn't exist. It's called 'sqlite3'.

SQLite is an embedded database; it is typically not installed, but compiled into whatever program is used to access the database.
All the typical server-side extension languages (PHP, Ruby, Python, Perl etc.) have support modules for SQLite.
You have to check which one of those are installed on the server, and whether SQLite support has been enabled for them.

Related

putting Navicat files in git?

I'm looking at switching from MySQL Workbench to Navicat because we're using MariaDB and the incompatibilities are starting to annoy me.
I'm working through the issues of getting Navicat to run on Centos under WINE but assume I will succeed (edit: this failed. The "linux" version requires WINE. Navicat will sort of run with a bit of hacking, but critical features rely on MS-Windows/WINE)
How do I get Navicat to work with git (or any other source code control)? Workbench is sufficiently primitive that file changes either get picked up automatically or completely ignored (almost always a dialog "file on disk has changed, reload?")
Specific problems:
when adding new query files Navicat only seems to rescan the folder when I add a new query. Is there a smart way to do that? (edit: no. You can manually refresh one file at a time by right clicking)
model and query files are buried deep in the WINE tree. Can I relocate them or or symlinks work? I'd rather keep all the DB-related code in one repo, rather than having a special Navicat repo. (edit: yes, but the explanation of how to do so is lengthy)
is there a way to merge a model file if more than one person has changed it? Workbench can't do this but I'd really like the feature. (edit: no, never. Merge the schema SQL files instead)
Also, bonus question: can we make multiple edits using Navicat other than repeated use of the GUI? If I want to change (say) a bunch of columns from VARCHAR(255) to CHAR(20) I'd normally script that in SQL but Navicat models don't do reverse engineering, only "delete the table from the model then re-import it" so there doesn't seem to be a non-tedious way to do that. (edit: no, but they might look at it in the future)
Final edit: I used the Navicat forums and the team were very helpful, but fundamentally Navicat is Windows software and the 64-bit purists behind Centos will never support WINE. For most Linux users this is not a problem, but I work with Centos enthusiasts and have long since lost the argument about which distro to use.
To the 1st question, you can sync it in different ways with a remote database/folder, when you are managing the database with Navicat, just right-click in your current connection and press "refresh", so you will be updated with the server changes. You also can do it with a programmed task.
Another matter is, why would you want to run navicat from wine when it has a native linux version? (I hope that answers the 2nd question)
For the 3rd question note that Navicat has an internal utility to sync data between servers, so you don't need git at all, or at most, you can automate the structure exportation and then sync it with a git repository (in form of a .sql file)
IMHO you need to review your concepts about mariadb and navicat, both are quite flexible and offer several ways to do such things you propose, like sync the data and they also allow to insert git in the workflow, just review your strategy and try to apply some new perspective with the available features.

Where are node-webkit database files stored?

I've just started to work with Node-webkit, and think it's great.
I've setup a db using the "Web SQL Database" option, mentioned here, and it seems to work well. Much like Sqlite, which I'm a bit familiar with.
From the docs, this is implemented using sqlite, so I'd like to be able to find the actual db file this create on disk and look at it with a Sqlite editor, like sqliteman.
Where is the db file saved to?
I couldn't find it in the docs, or by googling it ;-)
Since node-webkit version 0.6.1, you may retrieve the dataPath from the App object. The WebSQL files will be stored within the databases folder.
Wiki: https://github.com/rogerwang/node-webkit/wiki/App
Get the application's data path in user's directory.
Windows: %LOCALAPPDATA%/;
Linux: ~/.config/;
OSX: ~/Library/Application Support/ where is the field in the manifest.
Example:
require('nw.gui').App.dataPath;
I'm on a mac, and I used the tool Sloth to see the files that are opened by an application... Basically it's a GUI version of the command line lsof (list open files)
It pointed me to the following path:
~/Library/Application Support/YOUR_APP_NAME/databases/file__0/
and the sqlite db file was in there!

NSIS and SQLITE Integration

I am writing a installer for windows using NSIS. The installer gets few properties during installation and it needs to update one of the table in sqlite database that is bundled with the installer. Is it possible to update sqlite database file using NSIS?
It does not seem like there are any SQLite plugins.
Your options are:
Write your own plugin (included for completeness, but almost certainly not a real option)
Use nsExec to run SQLite commands via the command line interface. See discussion on NSIS forums
Write a small app to include with your installer that makes the required changes
Decision probably depends on how well you know the command line interface for SQLite vs. complexity of writing a small app to do what you want.
For #3, it would be similar to what you would do with a third party installer:
ReserveFile "myexe.exe"
...
SetOutPath $TEMP
File "myexe.exe"
ExecWait '"$TEMP\myexe.exe" /parameters"
alt option: http://sourceforge.net/projects/nsissqliteplug/
nsisSqlplugin::executeQuery "sqliteDatabase" "sql_query"
Limitations:
Currently the plugin executes only insert and update queries.

use sqlite with node.js - working module

I'm working on a node.js project and I would like to use some kind of database to store application data. I've searched for various DBMS and I've selected SQLite because I want my project to be able to run without installing heavy DBMS and because I want it to run both on linux and windows. however, all modules that we found, that connect node with SQLite are either very old, or cannot be installed due to bugs.
so, I want to ask if nowadays, 2012, there is a completely functional node.js module for SQLite.
I did a project last July (2012) in Node.JS v0.8.8, using the node-sqlite module (see https://github.com/developmentseed/node-sqlite3) and it worked just fine.
And, I successfully deployed and used this module on Heroku. However, the deployed portion of the project only involved reading out of the SQLite database – not writing. I suspect that writing into a SQLite deployed on Heroku would cause some issues, because it involves modifying the SQLite file in the file system, which AFAIK Heroku doesn't let you do.

Best way to handle and deploy XQuery stored procedures?

Is there a tool for deploying things into exist? if I've got a bundle of, say, schemas and XQuery stored procedures? Is there a way of, say, bundling those into a zip or tar file and uploading them or deploying them into eXist?
Alternatively what is the best way of storing these things in a version controlled way (in a git repo, say) and deploying them to the eXist server? Ideally, it'd be nice to be able to have a simple script in a scripting language so you can simply call "deploy.py" or whatever and it'd take everything from the repository and load it into the XML database.
The EXpath packaging system specifies a format for generating a ZIP file with XQuery procedures (and other content) and deploying it into multiple XQuery databases.
See the specification. You should be able to use the Python zipfile module to generate these if you're inclined to use Python (though personally, I do so from a makefile).
Unfortunately, the process for checking currently installed package versions to upgrade if necessary is not standardized; I have a solution for BaseX, but nothing for eXist immediately at hand. However, eXist's implementation is well-documented, and you should have little trouble working with it.

Resources