git.iko.soy/rowtype-yoga/purescript-yoga-postgres
on main help sign in
29 lines 643 B history raw
1-- EXPECT: TypesDoNotUnify
2module Test.CompileFail.JoinInvalidTable where
4import Prelude
5import Data.Maybe (Maybe(..))
6import Type.Function (type (#))
7import Type.Proxy (Proxy(..))
8import Yoga.Postgres.Schema
10type UsersTable = Table "users"
11 ( id :: Int # PrimaryKey # AutoIncrement
12 , name :: String
13 )
15type PostsTable = Table "posts"
16 ( id :: Int # PrimaryKey # AutoIncrement
17 , title :: String
18 , user_id :: Int
19 )
21usersTable :: Proxy UsersTable
22usersTable = Proxy
24postsTable :: Proxy PostsTable
25postsTable = Proxy
27bad = from usersTable
28 # innerJoin @"users.id = posts.user_id" postsTable
29 # select @"nonexistent_table.name"