Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fuss:sqlite [2016/02/15 11:49]
office
fuss:sqlite [2017/02/22 18:30] (current)
Line 1: Line 1:
 +====== Importing Delimited File ======
 +
 +To import a file called ''​data.csv'',​ first we create a table to hold that data, choose the delimiter (in this case ","​) and then import the data.
 +
 +<code sql>
 +sqlite> create table csvdata (id integer, datatype_id integer, level integer, meaning text);
 +sqlite> .separator ","​
 +sqlite> .import csvdata.csv test
 +</​code>​
 +
 +====== Showing Headers ======
 +
 +To show the column headers when issuing a command issue:
 +<​code>​
 +.headers ON
 +</​code>​
 +
 +In order to make sqlite always show the headers, add ''​.headers ON''​ to ''​~/​.sqliterc''​.
 +
 +====== Avoiding Locking Issues for SQLite databases on NFS Mounts ======
 +
 +As per the FAQ question on the [[https://​sqlite.org/​faq.html#​q5|SQLite FAQ]], SQLite does not work well if databases are hosted on NFS filesystems. The problem is that the locks requested by SQLite do not synchronize by default with the filesystem locks on share exported by the NFS server.
 +
 +One workaround is to mount the NFS share with the ''​nolock''​ (Linux) or ''​nolockd''​ (FreeBSD). This will enable locking on the client, such that locks will work on the client where the filesystem is mounted but they will not transfer over to the server.
 +
 +A different option would be to just switch over to NFSv4 (with or without Kerberos) that takes care of this issue and synchronizes locks. NFSv4 is supported in recent versions of FreeBSD by passing ''​nfsv4''​ as a mount option (can also be added to ''/​etc/​fstab''​).
  

fuss/sqlite.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.