(string)
| 560 | Booleans are converted to "0" and "1", None is converted to "null". |
| 561 | """ |
| 562 | def quote(string): |
| 563 | # How to escape strings differs between database engines. |
| 564 | if self.type == MYSQL: |
| 565 | #return "'%s'" % self._connection.escape_string(string) # Doesn't like Unicode. |
| 566 | return "'%s'" % string.replace("'", "\\'") |
| 567 | if self.type == SQLITE: |
| 568 | return "'%s'" % string.replace("'", "''") |
| 569 | return _escape(value, quote) |
| 570 | |
| 571 | def binary(self, data): |