Inconsistency in treatment of '\' character
Depending on your database, you may need to double-up the backslash, as many databases treat it as the default escape.

Just use four: '\\\\\\\\'. I think this behaviour needs to be hidden from the programmer. Besides, an ORM is abstraction layer over databases.
Because adding `\\\\` in the first query will make peewee to return nothing.

So when mixing `\` with '_', I suggest peewee add the following in its logic.
```python
str.replace('\\', '\\\\')
``` What database are you using? Also: are you running the latest version from master branch? I am using sqlite, and I am using the mater version of peewee. >I am using the mater version of peewee.

I think I know what the issue is, in that case. I made a recent change to the "contains()" method so that "_" and "%" within the search-string are properly escaped -- as you may know, these are wildcards that have special meaning for partial-string search. So if a string contains "_" or "%", the expression is converted somewhat. I believe I can fix this with a small addition. Thanks for reporting. Thanks!
I have the following database schema

```sql
CREATE TABLE "table" (
"id" integer,
"str" varchar(50),
 PRIMARY KEY (id)
);
INSERT INTO "table"("id","str") VALUES (1,'bar_foo\baz');
INSERT INTO "table"("id","str") VALUES (2,'bar');
INSERT INTO "table"("id","str") VALUES (3,'bar\foo');
```

and the following query

```python
ret = Table.select(Table.id).where(Table.str.contains('\\'))
for r in ret:
    print(r.id)
```

This prints the following as expected

```
1
3
```

However, when I have this query

```python
ret = Table.select(Table.id).where(Table.str.contains('_foo\\'))
for r in ret:
    print(r.id)
```

I expect peewee to dump

```
1
```
but, peewee dumps nothing.