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

Auto-detection of the database columns #14

Closed
17 tasks done
ozziest opened this issue May 22, 2021 · 0 comments · Fixed by #23
Closed
17 tasks done

Auto-detection of the database columns #14

ozziest opened this issue May 22, 2021 · 0 comments · Fixed by #23
Assignees
Labels
enhancement New feature or request
Projects

Comments

@ozziest
Copy link
Member

ozziest commented May 22, 2021

This issue has been created by the discussion in #846385235.

Why?

#846385235

  • Auto-detection columns in the initialization process.
    • Not easy to implement. We should add auto-detection codes for all databases that Knex.js supports.
    • Easy for developers. They don't have to define anything at all.
    • Great feature for documentation. We can show which model has what kind of columns, even their types.

How

  • Inject auto-detection library by the database type (For example, MySQL, MariaDB, etc.)
  • Detect all database columns (name, type, is_indexed vs) in the database by tables.
  • Bind those columns to the model instances.

Database Column Detectors

Common Schema

{
  "name": "id",
  "tableName": "users",
  "isNullable": false,
  "dataType": "Number",
  "defaultValue": null,
  "maxLength": null,
  "numericPrecision": null,
  "numericScale": null,
  "isPrimary": true,
  "isAutoIncrement": true
}

Documentation

  • Axe API should be able to list all possible columns in the documentation routes.

Column Checks

@ozziest ozziest added the enhancement New feature or request label May 22, 2021
@ozziest ozziest added this to To do in v1.0.0 via automation May 22, 2021
@ozziest ozziest changed the title Auto-detection columns by the database Auto-detection database columns May 22, 2021
@ozziest ozziest changed the title Auto-detection database columns Auto-detection of the database columns May 23, 2021
@ozziest ozziest moved this from To do to In progress in v1.0.0 May 26, 2021
@ozziest ozziest self-assigned this May 26, 2021
@ozziest ozziest linked a pull request May 26, 2021 that will close this issue
v1.0.0 automation moved this from In progress to Published May 29, 2021
@ozziest ozziest mentioned this issue May 29, 2021
2 tasks
@ozziest ozziest moved this from Published to Live in v1.0.0 Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
v1.0.0
Done!
Development

Successfully merging a pull request may close this issue.

1 participant