sql-load
Module for loading SQL
Last updated 6 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sql-load 
SYNC missed versions from official npm registry.

sql-load

AMD plugin for loading SQL

Warning - This module is still a work in progress, use at your own risk

Usage

var selectAll = require('sql-load')('./selectAll');
// selectAll is a string to use in a query
define([
  'sql-load!selectAll'
], function(selectAll){
  // selectAll is a string to use in a query
});

You can configure the loader through AMD config or the config method.

var sqlLoad = require('sql-load');

sqlLoad.config({
  basePath: __dirname + '/sql', // will load sql files from the sql/ directory inside current directory
  ext: '.txt' // will load files will extension .txt if one isn't specified
});

var selectAll = sqlLoad('./selectAll'); // loaded __dirname + '/sql/selectAll.txt';

basePath defaults to the current module.

ext defaults to '.sql'.

If you need to load a sql file async (this is used in the AMD plugin).

var sqlLoad = require('sql-load');

sqlLoad.async('./selectAll', function(err, selectAll){
  // selectAll is a string to use in a query
});

Current Tags

  • 0.0.2                                ...           latest (6 years ago)

3 Versions

  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |