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

sqlite: "database" path should be created (mkdirp?) #799

Closed
demaggus83 opened this issue Aug 26, 2017 · 1 comment
Closed

sqlite: "database" path should be created (mkdirp?) #799

demaggus83 opened this issue Aug 26, 2017 · 1 comment

Comments

@demaggus83
Copy link
Contributor

Given

# Example ormconfig.json
[
  {
    "name": "default",
    "type": "sqlite",
    "database": "./data/path/with/lot/sub/dirs/example.sq3",
    "autoSchemaSync": true,
    "entities": [
      "src/Model/*.js"
    ]
  }
]

My expection

The whole path "./data/path/with/lot/sub/dirs/" should be created

Result

Error: SQLITE_CANTOPEN: unable to open database file

Question

Bug? Should I fix this and make a pull request?
I would fix this after #798

@pleerock
Copy link
Member

This change will be released in 0.1.2

f-wrobel added a commit to f-wrobel/typeorm that referenced this issue Nov 9, 2017
* added cli options to init command generated project

* renamed TableSchema in to Table

* renamed ColumnSchema in to TableColumn;
renamed ForeignKeySchema in to TableForeignKey;
renamed IndexSchema in to TableIndex;
renamed PrimaryKeySchema in to TablePrimaryKey;

* added few websql-specific options

* added failing test

* Small fix for schema update after typeorm#858

The implementation of typeorm#858 broke the schema by altering the default valie without the metadata knowing about it.

This fixed it

* fixed test

* fixed linting error

* fixes typeorm#945

* fixed test

* made query runner to await

* fix: typeorm#953

* SchemaBuilder: Table.addPrimaryKeys and removePrimaryKeys also change isPrimary on the column

* fixed docs

* fixed countquery for sqlite based drivers

* update test
1. add enabledDrivers
2. assert array exactly the same

* fixed bug with duplicate entity columns in inheritance tree

* Fix column naming for deeper embedded entities

Example from provided test would be "countersInformationDescription" which previously would get database name "countersCountersInformationDescription". Problem was that parentEmbeddedMetadata was already taken into consideration when building prefix so anything deeper than one level would add earlier prefixes multiple times.

Previously `buildParentPrefixes` for `countersInformationDescription` would be `["counters", "counters_information]` and now it is simply `["counters_information"]`.

* updated docs, getting ready for 0.1.0 release

* updated mssql docker image

* docs update

* improving docs

* improving docs

* improving docs

* added ionic example to docs

* text case for issue typeorm#966

* docs: spelling and general improvements

* In the case of .env file, it will load the default .env file name.

It will introduce a breaking change because it will not locate ormconfig.env, instead it will search for a .env file.

* docs: spelling and general improvements (part 2)

* docs: spelling and general improvements (part 3)

* Now it will try to load ormconfig.env file and if it does not exists, it will then try to load the global .env file

* Workaround fix for typeorm#983

For some reason the null default values are reported as "NULL" on some columns. This is a small workaround for this particular case
MySQL does not have this issue, works fine

* docs: spelling and general improvements (part 4)

* reverted decorator-reference changed, changed links

* fixed links

* spelling and general improvements (part 5)

* issue typeorm#992 and typeorm#989

* merged other doc changes

* WebSQL version should be a string

* docs(websql): version is a string, not a number

* test(entity): added a testcase for typeorm#1002

* driver(websql): support uuid generated primary column

* improving docs

* improving docs

* improving docs

* improving docs

* improving docs

* improving docs

* improving docs

* improving docs

* version bump

* fixed issue with relation id loader not properly working with inverse many-to-many relations

* Update RelationIdLoader.ts

* added test for typeorm#1014

* removed only

* fixes typeorm#1011

* fixes typeorm#991

* fixes typeorm#990

* fixes typeorm#975

* fixes typeorm#975

* added 1 and -1 ordering support via find options. Added tests for typeorm#970

* fixes typeorm#966

* added typeorm-model-generator to extensions section in README

* added empty line

* added export to Database type, fixes typeorm#949

* deprecated isArray in column options

* fixed bug in transaction decorator

* added test for typeorm#948; fixed issue with array not working when defined alternatively way in entity

* fixed issue with array not working when defined alternatively way in entity

* reverted change making array column types to be determined automatically

* fixed issue with array not working when defined alternatively way in entity

* re-implemented update, updateById, removeById methods; added delete and insert methods

* fixing issues with new persistence methods

* fixes issues with update, insert, delete query builder; added support of embeds in there, plus in find options. Fixes typeorm#931 typeorm#971 typeorm#999 typeorm#942

* removed only tests, remove logs, fixed issue with sqlite insert default

* fixed broken test

* fixed broken test

* fixed broken test

* fixed broken test

* implemented multi-schema support in junction tables, fixes typeorm#1030

* fixed failing tests

* fixed failing tests; updated package deps

* version bump

* updated changelog

* expression was missing mode

* fixes typeorm#716

* Fix typo in migration docs

* fixes typeorm#1037

* fixes #typeorm#798 and typeorm#799

* fixes typeorm#1042

* better support operations with regular tables in query builders

* fixed compiler errors

* fixed compiler errors

* small changes

* docs: fix select-query-builder.md link

* added test for typeorm#1048

* removed only

* fixed broken version command

* refactoring persistence - step1

* refactoring persistence - step 2

* refactoring persistence - step 3

* refactoring persistence - step 4

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* driver(cordova): enabled foreign_keys

* add missing link to slides

* th -> the

* refactoring persistence

* refactoring persistence - removed cascade removes!

* fixed broken version command

* removed test because of removed cascade remove functionality

* refactoring persistence

* Adding cache options to repository

* Removing extra empty line

* Adding missing test and util logic

* Adding cache to find-options docs

* Updating changelog

* Updating caching docs to include new repository cache options

* added the citext column in postgres

* updated changelog for typeorm#1075

cc: @pleerock

* refactoring persistence

* refactoring persistence - added many to one uni directional tests

* fix: missing export TransactionRepository in index.ts

* Added sqlite type in ormTemplate

Fixed MissingDriver error for sqlite

* Add support for MongoDB authentication

* Add ObjectId conversion to `findOneById` method

* Add missing `create` overloads in `BaseEntity`

* refactoring persistence

* refactoring persistence

* refactoring persistence - added many to one uni directional tests

* refactoring persistence

* refactoring persistence

* refactoring persistence - added many to one uni directional tests

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* Update README.md

* refactoring persistence

* refactoring persistence

* fix changelog typo error

* refactoring persistence

* Fix tree entity sample code in docs

* refactoring persistence

* refactoring persistence

* refactoring persistence

* Update custom-repository.md

Minor typo

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* Wrong column name

I think you meant `categoryName` instead of `categoryId` here.

* refactoring persistence

* fixed compiler errors caused by typescript 2.6 upgration; version bump

* fixed indentation

* explicit require() statements for the drivers that call them

This allows us to bundle into a server.js with webpack. Useful for
Isomorphic JS projects.

* Fix minor typo in relations-faq.md

* fixed merging conflict issues

* refactoring persistence

* fixed bad query when using take on entity with multiple pk

* better style

* fixed failing citext test

* refactoring persistence

* Update CHANGELOG.md

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* refactoring persistence

* removed useless "schemaCreate: true" from tests

* removed useless "dropSchema: true" from tests

* removed useless "dropSchema: true" from tests

* refactoring persistence

* removed old way of inserting/updating/deleting in query runners

* give example for how to work with webpack, fix tslint errors

* switch the webpack how to to faq rather than its own file

* refactoring persistence

* added listeners and subscribers support via insert/update/delete query builders (typeorm#1104)

* moved broadcaster from the connection into query runner

* moved broadcaster from the connection into query runner

* implemented bulk insert and remove operations support (typeorm#1025)

* optimized remove process and implemented topological sorting in remove as well

* fixed issues with topological sorting and implemented transactions support in query builders

* refactoring persistence

* Correct typo in function name

Normilize -> Normalize
( i  -> a )

* reimplemented entity updation after save method call and after query builders calls mechanizm

* version bump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants