tsqlreader
Load SQL-queries from a file. Inside the file you write multiple queries like that in a file:
sql someName SELECT * from something;end#some comment /* multilinecomment*/// rest of line commentsql queryUsingFragment SELECT ${fragment} from ${prefix}somethingend sql fragment fieldOne as f, fieldtwo as fieldtwoend
As you see, this small lib supports commets and fragments in a simple format.
var sqlreader = ;var initialFragments = prefix: 'wp_';var queries = sqlreader; mysql;
for now this is all you need. the path, provided can be absolute, or relative to the current file or relative to process.cwd().
InitialFragments is an optional parameter, to predefine fragmets. In this case, it is used to provide a prefix for the table.
Developer
Tobias Nickel German software developer in Shanghai.