Skip to content

Instantly share code, notes, and snippets.

@Gavinok
Last active January 29, 2021 23:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gavinok/0c41f8232a5cf3684522c38f22de01c7 to your computer and use it in GitHub Desktop.
Save Gavinok/0c41f8232a5cf3684522c38f22de01c7 to your computer and use it in GitHub Desktop.
demo tsql a troff preprocessor for using sqlite in troff
.\" cat THISFILE | tsql | tbl | groff -Tpdf > THISFILE.pdf
Store info
.sqldb :memory:
.sqlbeg
create table Fam (
name text,
id integer
primary key
);
insert into Fam (name) values ('Gavin'), ('Chris'), ('Greg');
.sqlend
.TS
allbox;
cc.
name id
.sqltbl
select * from Fam;
.sqlend
.TE
.nr id 5
\n[id]
\"{{{
.sqlnr id
select id from Fam where name = 'Chris';
.sqlend
\n[id]
.sqlds name
select name from Fam where id = 2;
.sqlend
\*[name]
\"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment