Coder Social home page Coder Social logo

node-sqlite3-orm's People

Contributors

dependabot[bot] avatar gms1 avatar greenkeeper[bot] avatar greenkeeperio-bot avatar peterennis avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-sqlite3-orm's Issues

How do I get started with testing this?

I am new to using SQLite. What are the first steps to getting started?
When I know what I am doing I can provide a PR for the getting started doc that could also help others.
My initial goal is to investigate using SQLite with Ionic using promises/observables...

Tests hanging in cmd window

npm test

It ran for 10 minutes. Lots of disk activity and then stopped.
No output.
I checked the processes and it looked hung.
Used ^C to break and it continued.
Success reported.

capture335
capture336
capture337

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected πŸ€–


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

OneToMany Relationships

IΒ΄m using node-sqlite3-orm for my database and IΒ΄m in need of those. Are they already implemented or will they follow in one of the next versions? If they are already implemented how do I use them?

Types failing? Using @types/

I'm seeing this error now. Did something change in DefinitelyTyped?

node_modules/sqlite3orm/core/SqlDatabase.d.ts(25,20): error TS2709: Cannot use namespace 'Database' as a type.
node_modules/sqlite3orm/core/SqlStatement.d.ts(21,23): error TS2709: Cannot use namespace 'Statement' as a type.

Failed: SQLITE_CANTOPEN: unable to open database file

peter@Merry-Christmas MINGW64 /c/ae/node-sqlite3-orm (aedev)
$ gulp test
[22:09:27] mode: development
[22:09:27] Using gulpfile C:\ae\node-sqlite3-orm\gulpfile.js
[22:09:27] Starting 'dist:packageJson'...
[22:09:27] Starting 'dist:copyFiles'...
[22:09:27] Starting 'ts:tsc'...
[22:09:27] Starting 'ts:lint'...
[22:09:28] Finished 'dist:packageJson' after 521 ms
[22:09:28] Finished 'dist:copyFiles' after 519 ms
[22:09:28] Starting 'dist:files'...
[22:09:28] Finished 'dist:files' after 46 ΞΌs
[22:09:30] Finished 'ts:lint' after 2.92 s
[22:09:31] Finished 'ts:tsc' after 3.41 s
[22:09:31] Starting 'build'...
[22:09:31] Finished 'build' after 6.85 ΞΌs
[22:09:31] Starting 'test'...
Jasmine started

  test BaseDAO
    √ expect basic functionality (insert/update/delete/selectOne/selectAll) to work
    √ expect foreign key select to work

  test boolean type
    √ expect writing boolean properties to the database to succeed
    √ expect reading boolean properties from database to succeed

  test Date type
    √ expect writing Date properties to the database to succeed
    √ expect reading Date properties from database to succeed

  test Json data
    √ expect reading/writing Json properties from/to the database to succeed

  test README sample
    √ expect README sample to succeed

  test schema
    √ expect meta-data to be defined
    √ expect create/drop/alter-table to work (using Schema)
    √ expect create/drop/alter-table to work (using BaseDAO)

  test SqlConnectionPool
    Γ— expect pool to be able to open a database
      - Failed: SQLITE_CANTOPEN: unable to open database file

  test SqlDatabase
    √ expect insert without parameter to succeed
    √ expect insert without parameter to violate unique constraint
    √ expect insert without primary key to succeed
    √ expect update with parameter to succeed
    √ expect prepared update with parameter to succeed
    √ expect select without parameter to succeed
    √ expect select with parameter to succeed
    √ expect getting and setting PRAGMA user_version to succeed
    √ expect transaction to commit on end
    √ expect transaction to rollback on error

**************************************************
*                    Failures                    *
**************************************************

1) test SqlConnectionPool expect pool to be able to open a database
  - Failed: SQLITE_CANTOPEN: unable to open database file

Executed 22 of 22 specs (1 FAILED) in 0.057 sec.
[22:09:31] 'test' errored after 251 ms
[22:09:31] Error in plugin 'gulp-jasmine'
Message:
    Tests failed

An in-range update of @types/jasmine is breaking the build 🚨

The devDependency @types/jasmine was updated from 3.3.9 to 3.3.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/jasmine is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • βœ… coverage/coveralls: First build on greenkeeper/@types/jasmine-3.3.10 at 99.407% (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/fs-extra is breaking the build 🚨

The devDependency @types/fs-extra was updated from 5.0.5 to 5.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/fs-extra is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

Version 7.0.26 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 7.0.25
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/node is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of nyc is breaking the build 🚨

The devDependency nyc was updated from 14.0.0 to 14.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nyc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 15 commits.

  • c5d90fa chore(release): 14.1.0
  • 5cc05f4 chore: Update dependencies
  • 1e39ae1 chore: Refresh snapshots, update test/config-override.js to use helpers (#1085)
  • 3d9eaa4 fix: Purge source-map cache before reporting if cache is disabled. (#1080)
  • 132a074 feat: Add support for env.NYC_CONFIG_OVERRIDE (#1077)
  • 6fc109f chore: node.js 12 compatibility for object snapshot test. (#1084)
  • a7bc7ae fix: Use correct config property for parser plugins (#1082)
  • 600c867 chore: Convert some tap tests to run parallel and use snapshots. (#1075)
  • 56591fa docs: instrument docs update [skip ci] (#1063)
  • ca84c42 docs(codecov): favour npx over installing locally [skip ci] (#1074)
  • 85c1eac chore: Add test for nyc --no-clean. (#1071)
  • 21fb2c8 fix: Exit with code 1 when nyc doesn't know what to do. (#1070)
  • 0f745ca chore: Use class to declare NYC (#1069)
  • ca37ffa feat: add support for yaml configuration file (#1054)
  • c4fcf5e fix: Do not crash when nyc is run inside itself. (#1068)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of fs-extra is breaking the build 🚨

The devDependency fs-extra was updated from 7.0.0 to 7.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fs-extra is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 7 commits.

  • a32c852 7.0.1
  • 6392917 Temporarily disable standard-markdown
  • ddc1a2f Fix removeSync() to eliminate spurious ENOTEMPTY errors on Windows (#646)
  • ab254b1 Added docs/ and CHANGELOG.md to .npmignore (#642) (#643)
  • 287f234 Fix typo in docs (#628)
  • 402c1d0 Show support for mode (#587)
  • 4da17fe Chore: github issue template (#617)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 10.12.0 to 10.12.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).
  • βœ… coverage/coveralls: First build on greenkeeper/@types/node-10.12.1 at 99.555% (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

How do I create an app demo?

I am interested to test further by using the chinook SQLite sample database from here:

http://www.sqlitetutorial.net/sqlite-sample-database/

I will write a demo sample once I get it working.

What would be the TS class setup just to list employees using node-sqlite3-orm?

capture205

Using QueryModel to find booleans

I have a field defined as:

    @field({ name: 'tts_title_loaded' })
    ttsTitleLoaded: boolean = false;

I'm trying to search for ttsTitleLoaded == false.

This works:

const podcastQuery = new QueryModel(Podcast);
const podcasts = await podcastQuery.selectAll(await this.sqldb, {
    where: {
        not: { ttsTitleLoaded: true },
    },
});

but this does not:

const podcastQuery = new QueryModel(Podcast);
const podcasts2 = await podcastQuery.selectAll(await this.sqldb, {
    where: {
        ttsTitleLoaded: false,
    },
});

Is that expected?

failing tests because of "SQLITE_CANTOPEN: unable to open database file"

Planning to update getting-started and got the error while running tests.

C:\ae\aedev\node-sqlite3-orm>npm test

> [email protected] test C:\ae\aedev\node-sqlite3-orm
> npm run build && npm run test:run


> [email protected] build C:\ae\aedev\node-sqlite3-orm
> tsc -p tsconfig.json

src/sqlite3orm/AutoUpgrader.ts:2:23 - error TS7016: Could not find a declaration file for module 'debug'. 'C:/ae/aedev/node-sqlite3-orm/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm install @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

2 import * as _dbg from 'debug';
                        ~~~~~~~


src/sqlite3orm/core.ts:2:23 - error TS7016: Could not find a declaration file for module 'debug'. 'C:/ae/aedev/node-sqlite3-orm/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm install @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

2 import * as _dbg from 'debug';
                        ~~~~~~~


src/sqlite3orm/SqlConnectionPool.ts:4:23 - error TS7016: Could not find a declaration file for module 'debug'. 'C:/ae/aedev/node-sqlite3-orm/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm install @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

4 import * as _dbg from 'debug';
                        ~~~~~~~


src/sqlite3orm/SqlDatabase.ts:4:23 - error TS7016: Could not find a declaration file for module 'debug'. 'C:/ae/aedev/node-sqlite3-orm/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm install @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

4 import * as _dbg from 'debug';
                        ~~~~~~~


npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc -p tsconfig.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\peter\AppData\Roaming\npm-cache\_logs\2018-08-06T03_52_02_567Z-debug.log
npm ERR! Test failed.  See above for more details.

C:\ae\aedev\node-sqlite3-orm>

capture365

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.