Skip to content

Two problems with mysql #6

Closed
Closed
@void285

Description

@void285

I have been used pymedoo for several sqlite projects and it works well. Today I try to use it for mysql and found two problems. The script works well if change dbtype to sqlite from mysql.

1. table name quoted error

pymysql.err.ProgrammingError: (1064, u'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"test" LIMIT 1' at line 1'):
SELECT * FROM "test" LIMIT 1

I modify quote function in dialect.py to solve the problem, but not sure if this will cause more error.

    @staticmethod
    def quote(item):
        """How to quote values"""
        return str(item)

2. recordset not iteratable

File "C:\Python27\lib\site-packages\medoo\record.py", line 190, in next
nextrow = Record(self.meta, list(next(self._cursor)), readonly = self.readonly)
TypeError: Cursor object is not an iterator

This error occurs both in 0.0.3 with python27 or 0.0.5 with python37.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions