Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of SQLite3 connector #1

Merged
merged 1 commit into from
Jun 28, 2015
Merged

Initial implementation of SQLite3 connector #1

merged 1 commit into from
Jun 28, 2015

Conversation

kraman
Copy link
Contributor

@kraman kraman commented Jun 19, 2015

** This connector is based on postgresql connector

  • Remove tests for unimplemented features
  • Remove postgres related files
  • Update tests to use sqlite3 format

Connect to https://github.com/strongloop-internal/scrum-nodeops/issues/409

@rmg
Copy link
Contributor

rmg commented Jun 19, 2015

@slnode test please

** This connector is based on postgresql connector

* Remove tests for unimplemented features
* Remove postgres related files
* Update tests to use sqlite3 format
@raymondfeng
Copy link
Contributor

LGTM

@rmg
Copy link
Contributor

rmg commented Jun 23, 2015

The tests are passing on CI, but this is in the console:

Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.
Error
    at deprecate (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/moment/moment.js:738:42)
    at /mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/moment/moment.js:826:50
    at hookCallback (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/moment/moment.js:8:85)
    at Object.<anonymous> (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/moment/moment.js:11:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Object.Module._extensions.(anonymous function) [as .js] (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/build-framework/node_modules/istanbul/lib/hook.js:109:37)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/lib/sqlite3.js:9:509)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions.(anonymous function) [as .js] (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/build-framework/node_modules/istanbul/lib/hook.js:107:24)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/index.js:9:54)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions.(anonymous function) [as .js] (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/build-framework/node_modules/istanbul/lib/hook.js:107:24)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at global.getDataSource.global.getSchema (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/test/init.js:6:27)
    at Context.<anonymous> (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/test/sqlite.dbdefaults.test.js:10:10)
    at callFn (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/mocha/lib/runnable.js:266:21)
    at Hook.Runnable.run (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/mocha/lib/runnable.js:259:7)
    at next (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/mocha/lib/runner.js:271:10)
    at Object._onImmediate (/mnt/jenkins/workspace/loopback-connector-sqlite3.pr/eb78835e/node_modules/mocha/lib/runner.js:292:5)
    at processImmediate [as _immediateCallback] (timers.js:354:15)
[Error: Invalid date default: '5']

@kraman
Copy link
Contributor Author

kraman commented Jun 28, 2015

@rmg I am using moment to parse and check validity of the date being passed in. Do you know of a better library for that. I will merge but open an issue to address this.

kraman added a commit that referenced this pull request Jun 28, 2015
Initial implementation of SQLite3 connector
@kraman kraman merged commit 0b020e3 into master Jun 28, 2015
@kraman kraman deleted the fixups branch June 28, 2015 18:38
if (!isNaN(value))
return ' DEFAULT ' + Number(value);
var parsedValue = moment(value);
if (!parsedValue.isValid())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is inverted, which is why the test for an invalid default of '5' is passing. moment('5'), new Date('5') and Date.parse('5') all return ''Tue, 01 May 2001 07:00:00 GMT' or 988700400000 in epoch ms.

See #2

@kraman kraman restored the fixups branch July 9, 2015 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants