public inbox for [email protected]
help / color / mirror / Atom feedFrom: H <[email protected]>
To: PostgreSQL Users Mailing List <[email protected]>
Subject: Creating files with testdata
Date: Mon, 10 Mar 2025 14:09:15 -0400
Message-ID: <[email protected]> (raw)
I am developing a complex multi-tenant application in postgresql 16 in Linux. During the development I would like to be able to enter test data into various related tables at any given time for testing purposes.
While this can certainly be accomplished by predefined CTE INSERT statements in an SQL file, I would prefer something more flexible. I am thinking of using a markdown file as a source for these CTE INSERT statements. Specifically, having a certain structure in the markdown file where a given markdown heading level, bullet level etc. would correspond to specific tables and columns.
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.
Thanks.
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Creating files with testdata
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox