vellotis / knex-alasql

AlaSQL plugin dialect for knex.js
MIT License
4 stars 3 forks source link

Can't use custom dialect when using knexfile.js #1

Open whyayala opened 5 years ago

whyayala commented 5 years ago

I'm trying to setup knex on a project to allow it to seed and migrate to alasql from the cli. The cli settings are defined in knexfile.js. The settings work for the normal postgres client but with my setup for alasql

require('babel-register');

const alasqlClient = require('knex-alasql');

module.exports = {
    test: {
        client: alasqlClient,
        options: {
            postgres: true
        },
        seeds: {
            directory: config.get('knex.seeds.directory')
        }
    }

};

I get the following error:

Error: Cannot find module './dialects/function Client_AlaSQL(config) { _classCallCheck(this, Client_AlaSQL);

_Client_Postgres.call(this, config);
if (typeof config.options == 'object') {
  var options = _lodashPick2['default'](config.options, alasqlOptions);
  _lodashAssign2['default'](_alasql2['default'].options, options);
}
this.name = config.name || 'knex_database';
this.version = config.version || '1.0';
this.displayName = config.displayName || this.name;
this.estimatedSize = config.estimatedSize || 5 * 1024 * 1024;

}/index.js'

whyayala commented 5 years ago

My understanding from the documentation and this https://github.com/tgriesser/knex/pull/1428/files is that my configuration above should work. Would appreciate some insight on what I'm doing wrong.

vellotis commented 5 years ago

Hey. Sorry for late response. Do you still have an issue with that one? Or have you found a fix already?

whyayala commented 5 years ago

I was not able to get this working. We decided to abandon this implementation though. The consensus we came to was to just designate a testing db rather than trying to spoof it with a custom dialect like alasql. I may come back to this at some point but right now I've pivoted into another project.