querying jsonfields
Assuming you're using sqlite, right? yes  This may be related to a change in 3.11.0. If you're using 3.11.0 or newer, can you try using 3.10 and letting me know if it works there? currently on Version: 3.10.0
can try 3.11.0 if that may help I've just added a test for the `children()` method and it appears passing locally:

ddf4ce32c5ca180b2f93d01f731aaf161be4a2da

Does that help at all? Full code for the new test-case:

```python
    def test_children(self):
        children = KeyData.data.children().alias('children')
        query = (KeyData
                 .select(KeyData.key, children.c.fullkey.alias('fullkey'))
                 .from_(KeyData, children)
                 .where(~children.c.fullkey.contains('k'))
                 .order_by(KeyData.id, SQL('fullkey')))
        accum = [(row.key, row.fullkey) for row in query]
        self.assertEqual(accum, [
            ('a', '$.x1'),
            ('b', '$.x2'),
            ('d', '$.x1'),
            ('e', '$.l1'), ('e', '$.l2')])
``` Maybe try updating to 3.11.1 if you're still experiencing issues? I think I had the versions backwards -- that is, 3.10 had the issue which should be resolved in 3.11. no worries I will try upgrading now and see if that resolves the issue :) 
thank you  Oh shit, that test *is* failing on python 3... damn I was accidentally testing on python 2. I need to push a fix for this. tested and working 
additionally may I suggest the addition of 
```
  def __enter__(self):
        return self

    def __exit__(self, *args):
        return None
```

on the Alias class 
this allows the convenience of using with statements for context handling 

thus 
```
with User.phone.children().alias('phone_children') as phone:
    for row in User.select().from_(User, phone).where(phone.c.value ** '704%'):
        ...
```

I imagine this would probably be handy on the CTE class as well..  Glad it's fixed. I tagged 3.11.2 release w/the fix.

I'm not a fan of implementing a context manager that does ... nothing. That is just a slower way of doing a simple assignment. it might allow the garbage collector to recognize the transience of the assignment and toss the disposable variable after as it drops out of scope but mostly its an aesthetic/familiarity case of working similar to the SQL WITH clause where its used for virtual tables and common table expressions.
its not a major thing more a nice to have
Hi there,


Having a little trouble figuring out the children or json_each function in peewee

trying to replicate the basic example 
`SELECT DISTINCT user.name
  FROM user, json_each(user.phone)
 WHERE json_each.value LIKE '704-%';`

however I can't see an example in the documentation 

tried mocking up my own effort 
```
phone = User.phone.children().alias('phone_children')
query = User.select().from_(User, phone).where(phone.c.value ** '704%')
```

however had some issues trying to execute this getting TypeError: unhashable type: 'Alias'
I am fairly certain I am going about this backwards :( 