-
Notifications
You must be signed in to change notification settings - Fork 32
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
insert entire row with a specifc datatype #344
Comments
I guess it's a bit more complicated because you'd have to carry along the labels split from the input type in a wrapper around Manipulation |
I've tried at times to make a |
I don’t think going via the numbers is a good idea tbh. I don’t have a solution written out though so I can be wrong |
Thank you for writing this library. It’s awesome. Compile times are of course ass (21s spent in the simplifier) but that’s just GHCs fault. |
class All KnownNat ixs
=> HasParams (ixs :: [Nat]) (params :: [NullType]) (tys :: [NullType]) where
parameters :: NP (TypeExpression db) tys -> NP (Expression grp lat with db from) tys
instance HasParams '[] params '[] where
parameters Nil = Nil
instance (HasParam ix params ty, HasParams ixs params tys)
=> HasParams (ix:ixs) params (ty:tys) where
parameters (ty :* tys) = parameter @ix @params ty :* parameters @ixs @params tys
params
:: forall ns tys lat with db params from grp
. (All (NullTyped db) tys, HasParameters ns params tys)
=> NP (Expression grp lat with db params from) tys
params = parameters @ns (hcpure (Proxy @(NullTyped db)) (nulltype @db)) Maybe we can do something built on this? Haven't checked it. |
(Values_ (hmap ((`as` Alias) . Set) (params @'[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))) |
what I'm trying to say is can we just have something like |
so similarly to the |
thank you for your support! |
Oh those label types aren't thrown away.
Sure, you don't need to include the labels, The kind of the last type parameter of a |
We cannot avoid natural numbers because these actually correspond to PostgreSQL positional parameter numbers. |
Ah right that makes sense. Unfortunate. Well then we have to hack the natural numbers into place i guess |
@MangoIV something I've done in my last workplace was to aggressively use schemas and multiple Schema.hs files to cut down on squeal compile times, might be worth a go. |
Is there an intented way to express this generically?
In my case the names are exactly like the ones specified with the overloaded labels so it should be possible to just get the values from the types in the input type?
The text was updated successfully, but these errors were encountered: