I really like to write SQL by sprinkles, but I don't like to write SQL like this:
"select Notes.*, " +
"(select count(*) from NoteTagLinks where NoteTagLinks.note_id = Notes.id) as tag_count " +
"from Notes order by created_at desc"
So I added two methods to run SQL written in raw text files.
Just add text files(such as query_notes.sql) into raw folder, and write SQL directly in files.
I don't know how to write test case with raw files, but I tested it with sample model. It looks good.
I really like to write SQL by sprinkles, but I don't like to write SQL like this:
So I added two methods to run SQL written in raw text files. Just add text files(such as query_notes.sql) into raw folder, and write SQL directly in files.
I don't know how to write test case with raw files, but I tested it with sample model. It looks good.