Adding `migrationsDir` to config throws ESLint error

This issue has been tracked since 2022-09-16.

Describe the bug
Adding migrationsDir to the plugin's rules config results in an error:

Error: backend/.eslintrc.js:
	Configuration for rule "@ts-safeql/check-sql" is invalid:
	Value {"migrationsDir":"./lib/migrations","databaseUrl":"postgres://postgres:[email protected]:5432","name":"unstoppable_website_development","operators":["queryRunner.query"]} should NOT have additional properties.
	Value {"migrationsDir":"./lib/migrations","databaseUrl":"postgres://postgres:[email protected]:5432","name":"unstoppable_website_development","operators":["queryRunner.query"]} should NOT have additional properties.
	Value {"migrationsDir":"./lib/migrations","databaseUrl":"postgres://postgres:[email protected]:5432","name":"unstoppable_website_development","operators":["queryRunner.query"]} should NOT have additional properties.
	Value {"migrationsDir":"./lib/migrations","databaseUrl":"postgres://postgres:[email protected]:5432","name":"unstoppable_website_development","operators":["queryRunner.query"]} should NOT have additional properties.
	Value {"migrationsDir":"./lib/migrations","databaseUrl":"postgres://postgres:[email protected]:5432","name":"unstoppable_website_development","operators":["queryRunner.query"]} should match some schema in anyOf.

To Reproduce
Steps to reproduce the behavior:

add migrationsDir to the config.

Expected behavior
A clear and concise description of what you expected to happen.

For the configuration not to error.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • PostgreSQL version 11
  • Version 0.0.7

Additional context
Add any other context about the problem here.

Newbie012 wrote this answer on 2022-09-16

That's because you can't pass both databaseUrl and migrationsDir. The docs aren't very clear about that.

See example

PS

it looks like you want to change your connection configuration to:

{
  "migrationsDir": "./lib/migrations",
  "databaseName": "unstoppable_website_development_shadow_db",
  "queryRunner": "queryRunner",
  "operators": ["query"]
}
Newbie012 wrote this answer on 2022-09-20

Closing due to no response from the author.

If you're having hard time trying to configure your settings, then I suggest you to use useConfigFile with safeql.config.ts.

For more info, look the release notes of @ts-safeql/[email protected].

More Details About Repo
Owner Name ts-safeql
Repo Name safeql
Full Name ts-safeql/safeql
Language TypeScript
Created Date 2022-09-08
Updated Date 2023-03-16
Star Count 795
Watcher Count 5
Fork Count 14
Issue Count 7

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date