<commit_before># SQLite Command Line Utilities
Command line utilities to make working with SQLite databases more convenient
in file system utilities (e.g. ls) like manner.

  * sqls - for listing schema (tables) and table contents
  * sqle - for inserting and updating data in tables
  * sqld - for deleting data from tables

Currently a small project to learn Rust. Actual practical value yet to be determined ...

## Mapping tables and columns to a path

### Root
The root path / will correspond to the sqlite_master table.

### Path

```
{/[<table name>[/<filter>][/<columns>]}

<filter> = {<column name>=<value>[<operator>...]}

<operator> = [ & | ]

<columns> = {<column name>[,...]}
```

## sqls
List schema and content of a SQLite database via a filesystem like path.

Usage:

```
$ sqls [OPTIONS] <path> <db-file>
```

Given the following schema in blog.db:

```
CREATE TABLE entries (
  id PRIMARY KEY
  , created_at_utc TEXT DEFAULT (strftime('%Y-%m-%d %H:%m:%S.%s', 'now', 'utc'))
  , title TEXT NOT NULL
  , post TEXT
  , word_count INTEGER DEFAULT 0
);

CREATE INDEX entry_timestamp_index ON entries (created_at_utc);

CREATE TABLE tags (
  name TEXT PRIMARY KEY
  , created_at_utc TEXT DEFAULT (strftime('%Y-%m-%d %H:%m:%S.%s', 'now', 'utc'))
);

CREATE INDEX tag_timestamp_index ON tags (created_at_utc);

CREATE TABLE entry_tags (
  id INTEGER REFERENCES entries(id) ON UPDATE CASCADE
  , name TEXT REFERENCES tags(name) ON UPDATE CASCADE
  , PRIMARY KEY (id, name)
);<commit_msg>SQL schema typo fix in README.md<commit_after># SQLite Command Line Utilities
Command line utilities to make working with SQLite databases more convenient
in file system utilities (e.g. ls) like manner.

  * sqls - for listing schema (tables) and table contents
  * sqle - for inserting and updating data in tables
  * sqld - for deleting data from tables

Currently a small project to learn Rust. Actual practical value yet to be determined ...

## Mapping tables and columns to a path

### Root
The root path / will correspond to the sqlite_master table.

### Path

```
{/[<table name>[/<filter>][/<columns>]}

<filter> = {<column name>=<value>[<operator>...]}

<operator> = [ & | ]

<columns> = {<column name>[,...]}
```

## sqls
List schema and content of a SQLite database via a filesystem like path.

Usage:

```
$ sqls [OPTIONS] <path> <db-file>
```

Given the following schema in blog.db:

```
CREATE TABLE entries (
  id INTEGER PRIMARY KEY AUTOINCREMENT
  , created_at_utc TEXT DEFAULT (strftime('%Y-%m-%d %H:%m:%S.%s', 'now', 'utc'))
  , title TEXT NOT NULL
  , post TEXT
  , word_count INTEGER DEFAULT 0
);

CREATE INDEX entry_timestamp_index ON entries (created_at_utc);

CREATE TABLE tags (
  name TEXT PRIMARY KEY
  , created_at_utc TEXT DEFAULT (strftime('%Y-%m-%d %H:%m:%S.%s', 'now', 'utc'))
);

CREATE INDEX tag_timestamp_index ON tags (created_at_utc);

CREATE TABLE entry_tags (
  id INTEGER REFERENCES entries(id) ON UPDATE CASCADE
  , name TEXT REFERENCES tags(name) ON UPDATE CASCADE
  , PRIMARY KEY (id, name)
);
{'fraction_non_alphanumeric': 0.12561819980217606, 'fraction_numerical': 0.0006594131223211342, 'mean_word_length': 4.099159663865546, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2575469', 'n_tokens_mistral': 1048, 'n_tokens_neox': 971, 'n_words': 371}