Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

to much files been generated for services with db connection #67

Closed
Flippo24 opened this issue Oct 3, 2018 · 3 comments
Closed

to much files been generated for services with db connection #67

Flippo24 opened this issue Oct 3, 2018 · 3 comments

Comments

@Flippo24
Copy link

Flippo24 commented Oct 3, 2018

Why are more files been generated as needed, when generating a sevice and selecting an db-connection?

In this example with sequelize and mysql, the files users.mongo.js and users.mongoose.js aren't needed. Same happend when selecting mongodb. Then sequelize and mongoose files aren't needed.
Didn't checked all combinations.
I'm expecting only one of them to be genereated.

? What is the name of the service? users
? What would you call one row in the users database? user
? What kind of service is it? Sequelize
? Place service code in which nested folder, e.g. v1/blog? (optional)
? Which path should the service be registered on? /users
? Should this be served by GraphQL? Yes
skip src\services\users\users.class.js
skip src\services\users\users.interface.js
skip src\app.interface.ts
skip src\typings.d.ts

? Which database are you connecting to? MySQL (MariaDB)
? What is the database connection string? mysql://root:@localhost:3306/xyz
skip src\typings.d.ts
No locked version found for mysql2, installing latest.
skip src\typings.d.ts
force config\default.json
create test\services\users.test.js
create src\models\users.model.js
create src\services\users\users.service.js
create src\services\users\users.schema.js
create src\services\users\users.mongo.js
create src\services\users\users.mongoose.js

create src\services\users\users.sequelize.js
create src\services\users\users.validate.js
create src\services\users\users.hooks.js
force src\services\index.js
force src\app.js
create src\sequelize.js

@eddyystop
Copy link
Member

eddyystop commented Oct 3, 2018

Feathers advertises itself as being able to quickly switch between different databases. That is why all these files are potentially needed.

The reason they are actually generated is because you could add custom code to some of them. For example you added custom code to be used with the Sequelize adapter, and other custom code to be used with the Mongoose adapter.

All the modules are retained because you may be using the Sequelize adapter but, in order to quickly switch to the Mongoose adapter, the Mongoose module must have been retained.

@Flippo24
Copy link
Author

Flippo24 commented Oct 3, 2018

Thanks for explanation. So the same applies to graphql files?

@eddyystop
Copy link
Member

Yes.

@Flippo24 Flippo24 closed this as completed Oct 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants