(self)
| 936 | query = search |
| 937 | |
| 938 | def _insert_id(self): |
| 939 | # Retrieves the primary key value of the last inserted row. |
| 940 | if self.db.type == MYSQL: |
| 941 | return list(self.db.execute("select last_insert_id();"))[0][0] or None |
| 942 | if self.db.type == SQLITE: |
| 943 | return list(self.db.execute("select last_insert_rowid();"))[0][0] or None |
| 944 | |
| 945 | def insert(self, *args, **kwargs): |
| 946 | """ Inserts a new row from the given field parameters, returns id. |