19.9 C
Texas
angeloma
Senior Writer and partner

How to install SQLite on FreeBSD 12?

When we think of database relationships, MySQL and PostgreSQL come to mind. However, other programs offer different solutions for the same requirement. So in this post, I will show you how to install SQLite on FreeBSD 12.

SQLite is a small, reliable and very fast database engine. It is one of the most efficient database engines in the world. In part, thanks to that made in C Language which makes it very efficient in managing the resources of the system.

In like manner, the development of SQLite is so important that many major companies participate in it. This is done through the SQLite Consortium. In addition, all the code is available to be downloaded, viewed and reused for being open source.

So, let us start.

Install SQLite on FreeBSD 12

- Advertisement -

First of all, the system must be upgraded, so to do this, execute the following command:

:~$ sudo pkg update

As you can see, I’m using sudo. If you don’t have sudo enabled, you can read our post:

How to enable sudo on FreeBSD 12?

SQLite is available in the FreeBSD 12 repositories. To make sure of this, we will search the repositories:

:~$ sudo pkg search sqlite

And we’ll get the next result:

R-cran-RSQLite-1.0.0_4         Database Interface R driver for SQLite
R-cran-RSQLite.extfuns-0.0.1_11 SQLite extension functions for RSQLite
bogofilter-sqlite-1.2.5_2 Fast, teachable, learning spam detector
exim-sqlite-4.92.3 High performance MTA for Unix systems on the Internet
fpc-sqlite-3.0.4_3 Free Pascal interface to SQLite
linux-c7-sqlite-3.7.17_1 Library that implements an embeddable SQL database engine (Linux CentOS 7.7.1908)
lua52-lsqlite3-0.9.5 LuaSQLite3 - a Lua 5.1 to 5.3 wrapper for the SQLite3 library
luasql-sqlite3-2.5.0 Lua interface to SQLite3
ocaml-sqlite3-4.0.5 OCaml bindings to sqlite3 library
opensmtpd-extras-table-sqlite-6.6.0,1 SQLite table support for OpenSMTPD
p5-Apache-Session-SQLite3-0.03_1 Use DBD::SQLite 1.x for Apache::Session storage
p5-CPAN-SQLite-0.199_2 Search CPAN using a SQLite database
p5-Class-DBI-SQLite-0.11_2 Extension to Class::DBI for sqlite
p5-DBD-SQLite-1.64 Provides access to SQLite3 databases through the DBI
p5-DBD-SQLite2-0.38 Provides access to SQLite2 databases through the DBI
p5-DBIx-SQLite-Simple-0.35 Easy access to SQLite databases using objects
p5-DateTime-Format-SQLite-0.11_1 Parse and format SQLite dates and times
p5-Email-Sender-Transport-SQLite-0.092002_1 Deliver mail to an SQLite db for testing
p5-SQLite-Work-0.16.01_1 Report on and update an SQLite database
php72-pdo_sqlite-7.2.27 The pdo_sqlite shared extension for php
php72-pear-DB_Sqlite_Tools-0.1.7 an object oriented interface to backup Sqlite databases
php72-sqlite3-7.2.27 The sqlite3 shared extension for php
php73-pdo_sqlite-7.3.14 The pdo_sqlite shared extension for php
php73-pear-DB_Sqlite_Tools-0.1.7 an object oriented interface to backup Sqlite databases
php73-sqlite3-7.3.14 The sqlite3 shared extension for php
php74-pdo_sqlite-7.4.2 The pdo_sqlite shared extension for php
php74-pear-DB_Sqlite_Tools-0.1.7 an object oriented interface to backup Sqlite databases
php74-sqlite3-7.4.2 The sqlite3 shared extension for php
proftpd-mod_sql_sqlite-1.3.6b_3 SQLite ProFTPD module
py27-sqlite3-2.7.17_7 Standard Python binding to the SQLite3 library (Python 2.7)
py27-sqlite3dbm-0.1.4_1 Sqlite-backed dictionary
py35-sqlite3-3.5.9_7 Standard Python binding to the SQLite3 library (Python 3.5)
py36-sqlite3-3.6.9_7 Standard Python binding to the SQLite3 library (Python 3.6)
py37-sqlite3-3.7.6_7 Standard Python binding to the SQLite3 library (Python 3.7)
py38-sqlite3-3.8.1_7 Standard Python binding to the SQLite3 library (Python 3.8)
pypy-sqlite3-6.0.0_1 Standard PyPy binding to the SQLite3 library
pypy3-sqlite3-6.0.0_1 Standard PyPy binding to the SQLite3 library
qt5-sqldrivers-sqlite2-5.13.2 Qt SQLite 2 database plugin
qt5-sqldrivers-sqlite3-5.13.2 Qt SQLite 3 database plugin
rubygem-dbd-sqlite3-1.2.5_1 SQLite3 driver for DBI-for-Ruby
rubygem-do_sqlite3-0.10.17 Ruby DataObjects driver to the SQLite DB engine version 3
rubygem-sqlite3-1.4.2 Ruby interface to the SQLite DB engine version 3
rubygem-sqlite3-ruby-1.3.3_1 Ruby interface to the SQLite DB engine version 3
sqlite-2.8.17_5 SQL database engine in a C library
sqlite-ext-miscfuncs-1.1_2 Math, string, and aggregate function library for SQLite
sqlite-ext-pcre-20100208_2 Regexp function for SQLite based on PCRE library
sqlite-ext-regexp-3.8.11.1_1 Regular-expression matcher using NFA engine for SQLite
sqlite-ext-spellfix-3.8.11.1_1 Search large vocabulary for close matches for SQLite
sqlite3-3.30.1 SQL database engine in a C library
sqlitebrowser-3.11.2_1 Visual tool to manage SQLite databases
sqliteconvert-0.1.2 Tools to convert SQLite3 schema files into documentation
sqlitejdbc-056_2 Java JDBC driver for SQLite
sqlitemanager-1.2.4 Multilingual web based tool to manage SQLite database
sqliteodbc-0.9996 ODBC driver for SQLite 3
sqliteodbc-sqlite2-0.9996 ODBC driver for SQLite 2
sqlitestudio-3.2.1_8 SQLite database GUI manager
tcl-sqlite3-3.30.1 SQLite extension for Tcl using the Tcl Extension Architecture (TEA)
vsqlite-0.3.13_17 Well designed and portable SQLite3 Wrapper for C++
1.- Search for the SQLite package
1.- Search for the SQLite package

As we can see in the image and in the screen output of the command, SQLite versions 2 and 3 are available. In this case, we will install version 3.

:~$ sudo pkg install sqlite3
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
sqlite3: 3.30.1
readline: 8.0.1

Number of packages to be installed: 2

The process will require 8 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]:
2.- Install SQLite on FreeBSD 12
2.- Install SQLite on FreeBSD 12

Once the installation is finished, we proceed to show the version of the program.

:~$ sqlite3 --version
3.- SQLite version
3.- SQLite version

Now let’s use it a little.

Using SQLite

Now that it is installed, we can create a new database in the following way:

:~$ sqlite3 example.db

In this case, it’s called example.db but you can give it another name.

Inside it, we’ll be able to create a table with several fields.

For example:

CREATE TABLE Student
(
Go VARCHAR(25) NOT NULL,
Name VARCHAR(25) NOT NULL,
Last_Name VARCHAR(25) NOT NULL,
Age INTEGER(2) NOT NULL,
CONSTRAINT pk_Student PRIMARY KEY (Id)
);
4.- Using SQLite on FreeBSD 12
4.- Using SQLite on FreeBSD 12

Of course, you can modify these values as you wish. Even add more.

Also, we’ll add some example data:

INSERT INTO Student (Id, Name, Last_Name, Age) VALUES ('Xy01','peter','bees',18);

And finally, we show them:

SELECT * FROM Student;
5.- SQLite on FreeBSD
5.- SQLite on FreeBSD

And that is it.

Remember that you can install SQLite Browse from the official repositories of almost all Linux distributions as well as on FreeBSD.

Conclusion

SQLite is a great database application and if we learn to use it, it would be a great help for our projects. Installing it is very easy and gives us a lot of work possibilities. In addition, the SQLite Browser makes the workflow too easy.

Share this post and join our Telegram Channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article