DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far...

Welcome! This is a Q&A website for computer programmers and users alike, focused on helping fellow programmers and users. Read more

What are you stuck on? Ask a question and hopefully somebody will be able to help you out!
+1 vote

Is there any (free) utility, or library, that can be used for helping with the manual creation of SQL scripts? Not a utility for backing up a database; I would like one instead that would allow me to specify some options such as tables, schemas, constraints, source files (CSV), and will output a well formatted .sql file.

by
edited by

1 Answer

+1 vote

Libraries for what language? From what I understand, you are looking for a query builder. There is one for Python called pypika. Since Python has a builtin CSV library (and there is a good one in the Pandas package too), you can easily build scripts which do what you describe.

by
0

Sorry, I didn't mean a query builder. I meant one for building SQL scripts. Say, for example, one that given a list of relations can automatically create SQL scripts with all the CREATE TABLE commands for various databases. I edited the question to make it more clear.

0

On a second take... this could be in fact what I need.

0

Nice! I wish I'd known about pypika sooner! Thank you!

Contributions licensed under CC0
...