kanimysql/core.py
def insert(self, value, ignore=False, commit=True):
        """
        Insert a dict into db.
        :type table: string
        :type value: dict
        :type ignore: bool
        :type commit: bool
        :return: int. The row id of the insert.
        """
        table = value._table_name

        value_q, _args = self._value_parser(value, columnname=False)
        _sql = ''.join(['INSERT', ' IGNORE' if ignore else '', ' INTO ', self._backtick(table),
                        ' (', self._backtick_columns(value), ') VALUES (', value_q, ');'])

        if self.debug:
            return self.cur.mogrify(_sql, _args)

        self.cur.execute(_sql, _args)
        if commit:
            self.conn.commit()
        value.id = self.cur.lastrowid

        return self.cur.lastrowid

        Insert a dict into db.
        :type table: string
        :type value: dict
        :type ignore: bool
        :type commit: bool
        :return: int. The row id of the insert.
        
Insert a dict into db.
Insert a dict into db .
def insert(self, value, ignore=False, commit=True):
        table = value._table_name
        value_q, _args = self._value_parser(value, columnname=False)
        _sql = ''.join(['INSERT', ' IGNORE' if ignore else '', ' INTO ', self._backtick(table),
                        ' (', self._backtick_columns(value), ') VALUES (', value_q, ');'])
        if self.debug:
            return self.cur.mogrify(_sql, _args)
        self.cur.execute(_sql, _args)
        if commit:
            self.conn.commit()
        value.id = self.cur.lastrowid
        return self.cur.lastrowid
def insert ( self , value , ignore = False , commit = True ) : table = value . _table_name value_q , _args = self . _value_parser ( value , columnname = False ) _sql = '' . join ( [ 'INSERT' , ' IGNORE' if ignore else '' , ' INTO ' , self . _backtick ( table ) , ' (' , self . _backtick_columns ( value ) , ') VALUES (' , value_q , ');' ] ) if self . debug : return self . cur . mogrify ( _sql , _args ) self . cur . execute ( _sql , _args ) if commit : self . conn . commit ( ) value . id = self . cur . lastrowid return self . cur . lastrowid
Insert a dict into db.
Insert a dict into db .
"""
        Insert a dict into db.
        :type table: string
        :type value: dict
        :type ignore: bool
        :type commit: bool
        :return: int. The row id of the insert.
        """
int. The row id of the insert.
int . The row id of the insert .
self
value
ignore
commit