From: | H <agents(at)meddatainc(dot)com> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Creating files with testdata |
Date: | 2025-03-10 21:13:33 |
Message-ID: | BA6A1F07-A278-4A70-A8DF-3231C2416BBF@meddatainc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On March 10, 2025 5:09:46 PM GMT-04:00, H <agents(at)meddatainc(dot)com> wrote:
>On March 10, 2025 3:22:41 PM GMT-04:00, Francisco Olarte
><folarte(at)peoplecall(dot)com> wrote:
>>On Mon, 10 Mar 2025 at 19:17, H <agents(at)meddatainc(dot)com> wrote:
>>...
>>> After entering my test data into the markdown file for the given
>test
>>scenario, I would then run an awk script or similar to create a SQL
>>file with the various CTE INSERT statements. Howevever, it gets
>complex
>>since I need to handle 1:N relationships between tables in the
>markdown
>>file...
>>> I hope the above outline is understandable and am interested in
>>comments and thoughts on my above approach.
>>
>>I do not think MD would be a good source format. Being a developer I
>>would recommend taking your favorite scripting language ( perl /
>>python / lua / js , whatever ), build a big object ( which can be
>>easily helped by some mini-functions to build a little DSL ) and then
>>spit sql from it ( for developemewnt it is normally better then using
>>whatever db connection your language has, as it leaves an
>>understandable sql script ).
>>
>>I have done this with perl for some projects, built a driver which
>>defined several helper functions, then dofile("xx.dat") which returned
>>a big hash and then a series of loops on the result to write the SQL
>>in whatever order was neccessary.
>>
>>Francisco Olarte.
>
>The plan is to use the same format for later adding information into
>the finished application. By the way, all information is text, either
>paragraphs, sentences or single words.
I am also contemplating using Pandoc to process the markdown file. Pandoc builds an AST which can then be processed as desired. Awk processes a file line-by-line which is not ideal.
From | Date | Subject | |
---|---|---|---|
Next Message | Rhys A.D. Stewart | 2025-03-10 22:28:39 | Re: exclusion constraint question |
Previous Message | H | 2025-03-10 21:10:44 | Re: Creating files with testdata |