e.g. https://github.com/timogoosen/dirsearchreporter
This tutorial will be covering how to use SQLite and will be a brief intro to SQLite, why and when to use it.
Then above mentioned repo contains some examples of using python3+ sqlite. Just take in mind that the code is not
perfect or production ready, this code is just to teach you by using some examples.
State the requirements the user needs in order to follow this tutorial.
Choose one of the following options:
A full description of the topics covered in this tutorial, plus the contents of the tutorial itself.
Description:
Article:
First of all let us cover how to install sqlite on your machine, perhaps your machine already has SQLite installed. You can check whether or not it has been installed with:
$ which sqlite3
If you don't have it installed then do the following:
Ubuntu:
$ sudo apt-get update && sudo apt-get install sqlite3
On OSX:
$ brew install sqlite
On FreeBSD:
$ sudo pkg install sqlite3-3.22.0_2
You might need to install this to get Python3.6 interacting with sqlite3 on FreeBSD:
$ sudo pkg install databases/py36-sqlite3
Now that we have sqlite installed we can start getting to work. Before we get to using sqlite, let's see where SQLite is used and what is it used for?
Now we know where SQLite is actively used, let's just have a brief overview of the very interesting history behind SQLite:
We are going to go over very basics of sqlite, first we will go over using the CLI and then once we've covered that we will go into some
more in depth examples. First let's open sqlite3 in , in-memory mode:
$ sqlite3
$ sqlite3 /directory/to/save/to/dbname.db
So for example:(You might test want to save your db to something less temporary than /tmp)
$ sqlite3 /tmp/dbname.db
Now we are gonna create a table and have a look at the schema of the table:
sqlite> CREATE TABLE presidents (id integer, surname varchar(60), name varchar(60), age integer, country varchar(60));
Now you can view the schema with:
sqlite> .schema
Insert some data into our tables:
sqlite> INSERT INTO presidents VALUES (1, "Trump", "Donald", 65,"US and A");
Turning on foreign key support:
sqlite> PRAGMA foreign_keys = ON;
This is just something I've figured out from using SQLite, I'm not going into detail, but you can try that out.
Some tooling to look at:
SQL Injection reading list:
I don't have any utopian-io submissions yet, this is my first submission so please follow me if you enjoyed this submission.
I really enjoy technical writing and you can expect many more articles like this one.
Here is some of the code used in the tutorial:
https://github.com/timogoosen/dirsearchreporter/blob/master/sqlitelogger.py
Thanks for reading. Please follow me if you found this interesting.