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

DenoDB Models' fields without Types? #384

Open
tachyon-ops opened this issue Apr 27, 2024 · 0 comments
Open

DenoDB Models' fields without Types? #384

tachyon-ops opened this issue Apr 27, 2024 · 0 comments

Comments

@tachyon-ops
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant