Matt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
Matt Mueller (Prisma Client PM)
ives
06/07/2019, 12:48 PMives
06/07/2019, 12:49 PMMarvin42
06/07/2019, 12:56 PMVlad Faust
06/07/2019, 1:22 PM@@id([ standup, user ])
is very frustrating, thoughVlad Faust
06/07/2019, 1:23 PMMatt Mueller (Prisma Client PM)
Vlad Faust
06/07/2019, 1:28 PMid
with pk
or pkey
🙂Vlad Faust
06/07/2019, 1:31 PM?
tokens are separated from type tokens, it's hardly readable which one is actually optional. In other languages, e.g. Crystal, nilable types have ?
highlighted in another color, which is not the case here. I could suggest @optional
or @nilable
keywords insteadMatt Mueller (Prisma Client PM)
@primary
or @key
, but were thinking that'd be too specific to relational databases. how do you feel about the @@
syntax?Vlad Faust
06/07/2019, 1:36 PM@@
is read as "class-level", which is compared to @
, "type-level", so it's intuitive IMOVlad Faust
06/07/2019, 1:36 PMMatt Mueller (Prisma Client PM)
?
be a different color! we're actually working on the syntax highlighting right now, this gist doesn't have the proper coloring.
I think you're right that we should highlight that. I'll take a look at crystal's syntax for inspiration.
Here's an early sneak peak at the syntax highlighting: https://cldup.com/X02Ji89inE.mp4Vlad Faust
06/07/2019, 1:40 PMVlad Faust
06/07/2019, 1:41 PM\t
, am I right?Vlad Faust
06/07/2019, 1:43 PMid Int @sequence(
name: "badges",
foo: bar
)
Matt Mueller (Prisma Client PM)
\t
width cause you could have a lot of them. As a Go dev, I prefer tabs though 🙂Vlad Faust
06/07/2019, 1:44 PMMatt Mueller (Prisma Client PM)
@attributes
, but i think we'll need to come up with something for long parameter inputs as well. we'll probably follow prettier's example of breaking up lines with more than 80 columns.Matt Mueller (Prisma Client PM)
\t
too, I hadn't thought of that 🙂Vlad Faust
06/07/2019, 1:45 PM@sequence
annotation has named arguments, while @relation
has explicit named tuple ({ cool: "ok" }
)Vlad Faust
06/07/2019, 1:46 PMwe'll probably follow prettier's example of breaking up lines with more than 80 columnsI'd avoid that. It would bring issues. If user wants, they would break the line for themselves. Most editors have wrapping, also
Matt Mueller (Prisma Client PM)
Vlad Faust
06/07/2019, 1:48 PMRight now we're thinking attributes can have 1 unnamed argument.That's the cleanest approach, which would lead to minimal confusion!
Vlad Faust
06/07/2019, 1:48 PMVlad Faust
06/07/2019, 1:49 PM@id("foo", 10)
is OK. You'd better avoid named arguments, like with @sequence
, as it's confused with the @relation
exampleVlad Faust
06/07/2019, 1:51 PMMatt Mueller (Prisma Client PM)
@relation({ ... })
.
We're definitely still thinking about this so your point is well-received 🙂Matt Mueller (Prisma Client PM)