eveningkid / denodb

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno

Home Page:https://eveningkid.com/denodb-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DenoDB Models' fields without Types?

tachyon-ops opened this issue · comments

Hi all,

Great software. I am working my way through it and loving it.

I have one question: I am following your example

class Flight extends Model {
  static table = 'flights';
  static timestamps = true;

  static fields = {
    id: { primaryKey: true, autoIncrement: true },
    departure: DataTypes.STRING,
    destination: DataTypes.STRING,
    flightDuration: DataTypes.FLOAT,
  };

  static defaults = {
    flightDuration: 2.5,
  };
}

const flight = new Flight();
flight.departure = 'London';
flight.destination = 'San Francisco';
await flight.save();

But flight.departure doesn't exist in Flight. Anyone could let me know why we can't try to add autocompletion/types to the fields? Or am I doing something wrong?

Regards, N