Ask HN: How do you store your external SQL statements? 4 points by wilsonfiifi 10y ago ↗ HN I was wondering what file format is considered appropriate for storing SQL statements outside of one's source code. I was considering XML (in CDATA tag). Any thoughts?
[–] svisser 10y ago ↗ How about .sql files? [–] angersock 10y ago ↗ This.Remember, SQL statements are source code. [–] ajuc 10y ago ↗ I imagine the problem is with assigning names to them.Usually I've seen people keeping them in hibernate xml with named queries, or some proprietrary .xml files.CDATA is overkill IMHO, easier to escape the few problematic characters. [–] SayWhatIMean 10y ago ↗ Nice becuase you can get SQL syntax highlighting.
[–] ajuc 10y ago ↗ I imagine the problem is with assigning names to them.Usually I've seen people keeping them in hibernate xml with named queries, or some proprietrary .xml files.CDATA is overkill IMHO, easier to escape the few problematic characters.
4 comments
[ 3.4 ms ] story [ 22.1 ms ] threadRemember, SQL statements are source code.
Usually I've seen people keeping them in hibernate xml with named queries, or some proprietrary .xml files.
CDATA is overkill IMHO, easier to escape the few problematic characters.