LATERAL join without on=
Can you share your desired SQL? Possibly there's some quirk in Postgresql's query grammar that requires the "ON true" clause. That's rather annoying that it's so particular about it -- but for now I'll suggest using `SQL('true')` until I can look into this a bit more. The desired SQL would be 

```
WITH "sample" AS (
    SELECT "t1"."pk", "t1"."ra", "t1"."dec" FROM "sky" AS "t1" WHERE ("t1"."pk" > 200000)) 
SELECT "sample"."pk", "t2"."pk" FROM "sample" LEFT JOIN LATERAL (
    SELECT "sample"."pk" FROM "sky" AS "t3" WHERE (("t3"."pk" IN (SELECT * FROM "sample")) AND q3c_join("sample"."ra", "sample"."dec", "t3"."ra", "t3"."dec", 0.0016666666666666668)) ORDER BY q3c_dist("sample"."ra", "sample"."dec", "t3"."ra", "t3"."dec") ASC LIMIT 1 OFFSET 1) 
AS "t2" ON true WHERE ("t2"."pk" IS NULL)
```

The only think that doesn't seem to be output is the `ON true`.

I agree that using `SQL('true')` is better than the `'true'` string and it fixes the problem for me.  Ahhh, I think I know what the issue is!

This was only fixed recently, in 8829c948 -- which will automatically add the "on true" expression whenever you use a lateral join. So you might try upgrading to 3.13 or newer.
I'm trying to do the following query

```python
class Sky(peewee.Model):

    pk = peewee.PrimaryKeyField()
    ra = peewee.FloatField()
    dec = peewee.FloatField()

    class Meta:
        db_table = 'sky'
        database = database

# Select a sample here. For now use just a filter on pk for testing.
sample = (Sky
          .select()
          .where(Sky.pk > 200000)
          .cte('sample'))

subq = (Sky
        .select(sample.c.pk)
        .where(
            peewee.fn.q3c_join(sample.c.ra, sample.c.dec, Sky.ra, Sky.dec, 1. / 600))
        .order_by(
            peewee.fn.q3c_dist(sample.c.ra, sample.c.dec, Sky.ra, Sky.dec).asc())
        .limit(1)
        .offset(1))

ss = (sample
      .select_from(sample.c.pk, subq.c.pk)
      .join(subq, peewee.JOIN.LEFT_LATERAL)
      .where(subq.c.pk.is_null())
      .with_cte(sample))

ss.execute()
```

This query fails with 

```
peewee.ProgrammingError: syntax error at or near "WHERE"
LINE 1: ..."."ra", "t3"."dec") ASC LIMIT 1 OFFSET 1) AS "t2" WHERE ("t2...
```

If I add an `on=true` to the left lateral join, that translates into an `ON 1` in the SQL query which fails with 

```
ERROR:  argument of JOIN/ON must be type boolean, not type integer
LINE 1: ...ra", "t3"."dec") ASC LIMIT 1 OFFSET 1) AS "t2" ON 1 WHERE ("...
```

If I do something like `on='true'` that works, I assume because it's always evaluated as true. I wonder if there's a better way of doing this or if peewee should add the `ON true` automatically.

Also, I'm not sure if the example [here](http://docs.peewee-orm.com/en/latest/peewee/hacks.html#postgres-lateral-joins) is incomplete since it does not include an `on=` clause.

