SQLite: Difference between revisions

Jump to navigation Jump to search
No change in size ,  4 years ago
no edit summary
No edit summary
Line 6: Line 6:


You can access an SQLite database directly using the native client:
You can access an SQLite database directly using the native client:
{{Command|sqlite3 foo.sqlite3}}
{{Command|sqlite3 foo.sqlite}}
If the file <tt>foo.sqlite3</tt> does not already exist, the SQLite software will create it and the client starts in an empty database, otherwise you are connected to the existing database. You may then execute whichever queries you wish on the database, such as <tt>SELECT * FROM tablename;</tt> to print to the screen the entire contents of the table <tt>tablename</tt>.
If the file <tt>foo.sqlite</tt> does not already exist, the SQLite software will create it and the client starts in an empty database, otherwise you are connected to the existing database. You may then execute whichever queries you wish on the database, such as <tt>SELECT * FROM tablename;</tt> to print to the screen the entire contents of the table <tt>tablename</tt>.


==Accessing SQLite from software==
==Accessing SQLite from software==
Line 19: Line 19:
Using R, the first step is to install the <tt>RSQLite</tt> package in your R environment, after which you can use code like the following to interact with the SQLite database,
Using R, the first step is to install the <tt>RSQLite</tt> package in your R environment, after which you can use code like the following to interact with the SQLite database,
{{File
{{File
   |name=test.R
   |name=sqlite.R
   |lang="r"
   |lang="r"
   |contents=
   |contents=
Bureaucrats, cc_docs_admin, cc_staff
2,318

edits

Navigation menu