Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
fuss:sqlite [2016/02/15 11:49] officefuss:sqlite [2022/04/19 08:28] (current) – external edit 127.0.0.1
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: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


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