MCPcopy Index your code
hub / github.com/clips/pattern / _insert_id

Method _insert_id

pattern/db/__init__.py:938–943  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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.

Callers 1

insertMethod · 0.95

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected