PhilWaldmann / openrecord

Make ORMs great again!
https://openrecord.js.org
MIT License
486 stars 38 forks source link

VScode Intellisense for auto generated models #94

Open Snowsoul opened 5 years ago

Snowsoul commented 5 years ago

I was wondering if it's possible to return the auto loaded models from a mysql database as a class with the db structure and use that to offer auto completion in VSCode.

Use Cases:

  1. I would like to get the User table column name suggestions like: user_id, first_name, last_name inside where's object parameter.
screenshot 2019-03-07 at 14 20 11
  1. I would like to get the same column name suggestions inside get's string parameter. screenshot 2019-03-07 at 14 20 59
PhilWaldmann commented 5 years ago

Hi @Snowsoul

that's one thing I want to achieve with the next version. But it's a big rewrite.

Currently the fields per model will be loaded while you are waiting for store.ready() to finish. In order to get intellisense autocompletion, we need to load all model information in advance and store them as typescript definitions.

Snowsoul commented 5 years ago

Awesome, looking forward to that 😄