Skip to content
application source generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md Adding some GitHub files. Apr 10, 2017
Makefile Get ready for version. Jul 17, 2019
README.md
TODO.md
archive.xml Polish www and release version. Jul 5, 2019
atom-template.xml Links and archives don't use "ort", they use "openradtool". Mar 22, 2019
audit-example.txt
audit.c Move reserved identifier check into config.c, allow logger to handle … Jul 7, 2019
audit.css Make integration into other pages easier (prefixing). Mar 9, 2018
audit.html Links and archives don't use "ort", they use "openradtool". Mar 22, 2019
audit.js
b64_ntop.c Fix compilation errors. Sep 26, 2018
comments.c Note FIXME about epilogue overriding. Jul 14, 2019
compats.c Bring in new oconfigure. Dec 27, 2018
config.c Move reserved identifier check into config.c, allow logger to handle … Jul 7, 2019
configure Bring up to speed with newest oconfigure. Jul 1, 2019
db.fr.xml Rename kwebapp-xliff manpage and binary to ort-xliff. Mar 21, 2019
db.old.txt Require a semicolon after a structure. This is future-proofing for ha… May 5, 2017
db.txt
extern.h Commit bits so that the current max/min/group return the row correspo… Mar 16, 2019
gensalt.c Edging in first JSON parsing routines. Still a work in progress. Sep 12, 2018
header.c Move reserved identifier check into config.c, allow logger to handle … Jul 7, 2019
index-fig0.dot Start overhaul of www materials for kwebapp to ort rename. Mar 21, 2019
index-fig1.dot Make images be LR, fix some sqlite -> sqlite3, change links to ort, note Mar 22, 2019
index-fig2.dot Make images be LR, fix some sqlite -> sqlite3, change links to ort, note Mar 22, 2019
index-fig3.dot Make images be LR, fix some sqlite -> sqlite3, change links to ort, note Mar 22, 2019
index-fig4.dot
index-fig5.dot
index-fig6.dot Make images be LR, fix some sqlite -> sqlite3, change links to ort, note Mar 22, 2019
index-fig7.dot Add alt tags and clean up mobile view of first image. Mar 23, 2019
index.css
index.dot
index.xml
index2.dot Rename kwebapp(1) and its binary as ort(1). This is part of the migra… Mar 21, 2019
javascript.c
jsmn.c Inspired by the <0 libc return value jihad... Jul 11, 2019
kwbp.vim
linker.c Remove CFG_HAS_ROLES, which was just superfluous atop TAILQ_EMPTY(&cf… Jul 7, 2019
main.c
mandoc.css
notugly.xsl
ort-audit-gv.1 Use common introduction to manpages. Jul 17, 2019
ort-audit-json.1
ort-audit.1
ort-c-header.1 Use common introduction to manpages. Jul 17, 2019
ort-c-source.1 Use common introduction to manpages. Jul 17, 2019
ort-javascript.1 Note how enums and bitfields have special format() functions if the name Jul 17, 2019
ort-sql.1 Use common introduction to manpages. Jul 17, 2019
ort-sqldiff.1 Use common introduction to manpages. Jul 17, 2019
ort-xliff.1 Use common introduction to manpages. Jul 17, 2019
ort.1 Rename kwebapp(1) and its binary as ort(1). This is part of the migra… Mar 21, 2019
ort.5 Document "count". Jul 4, 2019
ort.h Move reserved identifier check into config.c, allow logger to handle … Jul 7, 2019
parser.c Move reserved identifier check into config.c, allow logger to handle … Jul 7, 2019
printer.c Guard sys/queue.h. Dec 27, 2018
protos.c Finish proper line-breaking in C API. Jul 3, 2019
source.c Remove superfluous. Jul 18, 2019
sql.c Properly check for zero configurations before allocating memory. Jul 17, 2019
test.c Guard sys/queue.h. Dec 27, 2018
test.xml Start overhaul of www materials for kwebapp to ort rename. Mar 21, 2019
tests.c
versions.xml
writer.c
xliff.c Apply style(9). Jul 17, 2019

README.md

Introduction

openradtool ("ort") translates a data model (data layout and operations) into C, SQL (SQLite3), and TypeScript/JavaScript code. It also has a raft of related features, such as role-based access control, auditing, full documentation of generated sources, etc.

There's nothing in ort that's specific to C or SQLite. This is simply what I currently use as output.

The generated files currently use ksql(3) to wrap around SQLite and (optionally) kcgi(3) for JSON or validation output.

ort requires the newest library versions to operate: all of these tools are built in tandem.

Why is ort handy? It removes a lot of "boilerplate" code querying the database and allocating objects. Some additional features:

  • Functions generated for modifying (updates), allocating (inserts), and accessing (queries).
  • Automagic foreign key "INNER JOIN" when accessing structures. The configuration specifies nested structures and ort creates the "join" functionality when querying for those objects.
  • Several types of accessors: iterator-based (function callback), list-based (queue), and unique (selecting on unique fields).
  • Well-formed, readable C and SQL output describing functions (if applicable), variables, structures, and so on.
  • "Difference calculator" between configuration files helps database updates be reasonable by providing the necessary "ALTER TABLE" and so on to help with versioning. (Also protects against accidental incompatible changes.)
  • Beyond the usual native type support (int, text, real, blob), also supports "password" type that has automatic hashing mechanism built-in during selection from and insertion into the database.
  • Several different types of SQL query (and update and delete) operators.
  • Optional JSON output functions.
  • Optional JSON input functions.
  • Optional field validation (kcgi(3)) functions.
  • Well-documented JavaScript or TypeScript handling of the JSON output generator.
  • Role-based access control enforced by process separation.
  • Auditing of role-based access control.

See the TODO for what still needs to be done.

This repository mirrors the main repository on BSD.lv. ort is still under development!

Installation

ort runs best on OpenBSD, since this system offers the most comprehensive security. Why is this significant? With OpenBSD, processes may stipulate resource constraints effectively making them unable to change their running environment: for example, an application process may disable the facility to read files after spawning the database process. This effectively walls away the database from the application.

The sources generated by ort will also work on Linux, FreeBSD, and Mac OSX.

If your operating system doesn't already have ort bundled as a third-party system, simply download and run the usual ./configure and doas make install.

License

All sources use the ISC (like OpenBSD) license. See the LICENSE.md file for details.

You can’t perform that action at this time.