Having a PostgreSQL DB model defined in SQL, i would like to generate an org-mode file with a bunch of org mode tables to document it.
So for each CREATE TABLE, it creates an org-mode table with its name and fields:
CREATE TABLE film_actor ( actor_id integer NOT NULL, film_id integer NOT NULL, last_update timestamp without time zone DEFAULT now() NOT NULL ); CREATE TABLE film_category ( film_id integer NOT NULL, category_id integer NOT NULL, last_update timestamp without time zone DEFAULT now() NOT NULL ); ... Something like:
| film_actor | type | other | | -------- | ---------| --- | | actor_id | integer | NOT NULL | | film_id | integer | NOT NULL | | last_update | timestamp | without time zone DEFAULT now() NOT NULL | | film_category | type | other | | -------- | ---------| --- | | film_id | integer | NOT NULL | | category_id | integer | NOT NULL | | last_update | timestamp | without time zone DEFAULT now() NOT NULL | ... Is there already some library that does something similar to this?
If not, any hints or strategy how to do the parsing?
My ELisp skills are kind of basic, so any hint will help.