W
Wasp-lang•8mo ago
cgduzan

List of scalars in entities

Does Wasp support lists of scalars when defining entities? For example:
entity Recipe {=psl
...

prepSteps String[]

...
psl=}
entity Recipe {=psl
...

prepSteps String[]

...
psl=}
I'm getting errors when trying to run a migration with code like this.
No description
7 Replies
matijash
matijash•8mo ago
hey @cgduzan ! You are probably using Sqlite, which comes by default (easier to get things running and test wasp out)? Scalar lists are not supporthed for sqlite, so you should switch to postgres, which is anyhow recommeded for production.
matijash
matijash•8mo ago
You can find more about switching from sqlite to postgres here 🙂 https://wasp-lang.dev/docs/data-model/backends#migrating-from-sqlite-to-postgresql
Databases | Wasp
Entities, Operations and Automatic CRUD together make a high-level interface for working with your app's data. Still, all that data has to live somewhere, so let's see how Wasp deals with databases.
cgduzan
cgduzan•8mo ago
That did the trick! Thank you!
MEE6
MEE6•8mo ago
Wohooo @cgduzan, you just became a Waspeteer level 1!
cgduzan
cgduzan•8mo ago
Is it expected that wasp db studio doesn't work once I switched to Postgres?
matijash
matijash•8mo ago
No it should still work Whats the problem?
cgduzan
cgduzan•8mo ago
Weird... it's working now. I don't think I changed anything. Who knows 🤷