{"id":1100,"date":"2010-03-24T18:11:41","date_gmt":"2010-03-24T22:11:41","guid":{"rendered":"http:\/\/crazedmonkey.com\/blog\/links\/sqlalchemy-does-not-force-case-sensitive-matching-for-mysql-or-any-other-dbs.html"},"modified":"2010-03-24T18:11:41","modified_gmt":"2010-03-24T22:11:41","slug":"sqlalchemy-does-not-force-case-sensitive-matching-for-mysql-or-any-other-dbs","status":"publish","type":"post","link":"http:\/\/crazedmonkey.com\/blog\/links\/sqlalchemy-does-not-force-case-sensitive-matching-for-mysql-or-any-other-dbs.html","title":{"rendered":"SqlAlchemy does not force case-sensitive matching for MySQL (or any other) DBs"},"content":{"rendered":"<p>MySQL defaults to case-insensitive string comparison. SqlAlchemy does not do anything to mask this behaviour, and rightly so. This SqlAlchemy bug contains the reasoning as well as links to articles on how to configure MySQL tables and columns to use case-sensitive comparisons.<\/p>\n<p>When defining a column or a table in MySQL, you can specify the charset as utf8. By default, the collation will be utf8_general_ci, which is case-insensitive. Specifying the collation as utf8_general_cs will result in case-sensitive comparisons.<\/p>\n<p>You can also precede the MySQL column name with &#8220;BINARY&#8221; in a WHERE or LIKE clause. This will force the column to act as a binary column, thus inducing case-sensitive comparisons. The COLLATE clause in a SELECT can also be used to override whatever the default collation is for a comparison. COLLATE may be used in various parts of SQL statements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL defaults to case-insensitive string comparison. SqlAlchemy does not do anything to mask this behaviour, and rightly so. This SqlAlchemy bug contains the reasoning as well as links to articles on how to configure MySQL tables and columns to use case-sensitive comparisons.<\/p>\n<p>When defining a column or a table in MySQL, you can specify the&nbsp;&hellip;&nbsp;<a class=\"read_more\" href=\"http:\/\/crazedmonkey.com\/blog\/links\/sqlalchemy-does-not-force-case-sensitive-matching-for-mysql-or-any-other-dbs.html\" rel=\"bookmark\" title=\"Continue reading &ldquo;SqlAlchemy does not force case-sensitive matching for MySQL (or any other) DBs&rdquo;\"><span>Read more<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[33],"tags":[],"_links":{"self":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts\/1100"}],"collection":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/comments?post=1100"}],"version-history":[{"count":0,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/posts\/1100\/revisions"}],"wp:attachment":[{"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/media?parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/categories?post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/crazedmonkey.com\/blog\/wp-json\/wp\/v2\/tags?post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}