Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6734047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:50:33+00:00 2026-05-26T10:50:33+00:00

I have a simple MySQL script that I use in a web application to

  • 0

I have a simple MySQL script that I use in a web application to complete rebuild/reset my DB to a clean initial state. Thus, in this script I define the various tables, stored procs, etc. that I need.

This is fairly good initial solution b/c it’s simple and does the job without being overkill. However there are some drawbacks. One example is typing. It would be nice to define stored procs with richer types so I don’t need to repeat declarations like VARCHAR(64).

Thus, my question is: is there a good DSL for manipulating MySQL scripts? (e.g. it could ultimately generate valid MySQL scripts) that is effectively a nice DSL over MySQL, without trying to do too much and have too many bells and whistles. Would be nice if the language itself had decent support for DSL, but more importantly, it would be nice to find something that wasn’t heavily wedded to a particular web framework.

Some cursory searches did not yield anything immediately obvious.

I guess one practical alternative is to just use your favorite ORM as a way of getting at a solution that’s effectively nice. So part of the motivation of this question is to see if the DSL approach has been explored to any success.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:50:34+00:00Added an answer on May 26, 2026 at 10:50 am

    I’m assuming you mean an Internal DSL (see http://martinfowler.com/bliki/DomainSpecificLanguage.html, and http://en.wikipedia.org/wiki/Domain-specific_language) because SQL is a DSL, i.e. an External DSL (by Martin Fowler’s definition, which has gained fairly wide acceptance).

    Given that assumption, and not knowing what language you prefer, I was able to find a few Internal DSL’s for SQL code generation:

    • Ruby – sqldsl.rubyforge.org/
    • Java – code.google.com/p/sql-dsl/
    • Scala – github.com/p3t0r/scala-sql-dsl

    if you google “SQL DSL” there are more, also try googling “SQL DSL [enter your favorite language here]” and you may find something more suitable.

    Another approach which has a different set of advantages and disadvantages (than an internal DSL) would be generating the SQL code from a template. Either a template in the form of a string with variable escapes (or concatenation) or in a separate file using a template language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an extremely simple script with PHP exec , calling mysql command: $dbhost
I have a script that polls a MySQL database (Nagios, specifically) for the date/time
I have a very simple bit of script that changes the status of an
I have a complete automatic notification system running on my web page, that is
I have a PHP/5.2 driven application that uses transactions under MySQL/5.1 so it can
I have a simple MySQL table thats contains a list of categories, level is
I have got a simple MySQL table and primary index (id) is not numbered
I have a simple table in MySql whose raison-d'être is to store logs. The
I have problem with creating a simple MySQL trigger in C#. I'm using StringBuilder
So I have a simple Apache with MySql I am developing a PHP app.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.