labpack/databases/sql.py
def create(self, record):

        '''
            a method to create a new record in the table 

            NOTE:   this class uses the id key as the primary key for all records
                    if record includes an id field that is an integer, float
                    or string, then it will be used as the primary key. if the id
                    field is missing, a random 64 bit integer (if a number) or a
                    unique 24 character url safe string (if a string) will be 
                    created for the id field and included in the record

            NOTE:   record fields which do not exist in the record_schema or whose
                    value do not match the requirements of the record_schema
                    will throw an InputValidationError

            NOTE:   lists fields are pickled before they are saved to disk and
                    are not possible to search using sql query statements. it is
                    recommended that lists be stored instead as separate tables

            NOTE:   if a map field is declared as empty in the record_schema, then
                    all record fields inside it will be pickled before the
                    record is saved to disk and are not possible to search

        :param record: dictionary with record fields 
        :return: string with id for record
        '''

        # validate inputs
        record_details = self.model.validate(record)

        # prepare record
        fields = self._prepare_record(record_details)

        # insert record into table
        insert_statement = self.table.insert().values(**fields)
        self.session.execute(insert_statement)

        # report and return record id
        self.printer('Record %s created.' % fields['id'])

        return fields['id']

            a method to create a new record in the table 

            NOTE:   this class uses the id key as the primary key for all records
                    if record includes an id field that is an integer, float
                    or string, then it will be used as the primary key. if the id
                    field is missing, a random 64 bit integer (if a number) or a
                    unique 24 character url safe string (if a string) will be 
                    created for the id field and included in the record

            NOTE:   record fields which do not exist in the record_schema or whose
                    value do not match the requirements of the record_schema
                    will throw an InputValidationError

            NOTE:   lists fields are pickled before they are saved to disk and
                    are not possible to search using sql query statements. it is
                    recommended that lists be stored instead as separate tables

            NOTE:   if a map field is declared as empty in the record_schema, then
                    all record fields inside it will be pickled before the
                    record is saved to disk and are not possible to search

        :param record: dictionary with record fields 
        :return: string with id for record
        
a method to create a new record in the table
NOTE:   this class uses the id key as the primary key for all records
if record includes an id field that is an integer, float
or string, then it will be used as the primary key. if the id
field is missing, a random 64 bit integer (if a number) or a
unique 24 character url safe string (if a string) will be
created for the id field and included in the record

record fields which do not exist in the record_schema or whose
value do not match the requirements of the record_schema
will throw an InputValidationError

lists fields are pickled before they are saved to disk and
are not possible to search using sql query statements. it is
recommended that lists be stored instead as separate tables

if a map field is declared as empty in the record_schema, then
all record fields inside it will be pickled before the
record is saved to disk and are not possible to search
a method to create a new record in the table NOTE : this class uses the id key as the primary key for all records if record includes an id field that is an integer float or string then it will be used as the primary key . if the id field is missing a random 64 bit integer ( if a number ) or a unique 24 character url safe string ( if a string ) will be created for the id field and included in the record record fields which do not exist in the record_schema or whose value do not match the requirements of the record_schema will throw an InputValidationError lists fields are pickled before they are saved to disk and are not possible to search using sql query statements . it is recommended that lists be stored instead as separate tables if a map field is declared as empty in the record_schema then all record fields inside it will be pickled before the record is saved to disk and are not possible to search
def create(self, record):
        record_details = self.model.validate(record)
        fields = self._prepare_record(record_details)
        insert_statement = self.table.insert().values(**fields)
        self.session.execute(insert_statement)
        self.printer('Record %s created.' % fields['id'])
        return fields['id']
def create ( self , record ) : record_details = self . model . validate ( record ) fields = self . _prepare_record ( record_details ) insert_statement = self . table . insert ( ) . values ( ** fields ) self . session . execute ( insert_statement ) self . printer ( 'Record %s created.' % fields [ 'id' ] ) return fields [ 'id' ]
a method to create a new record in the table
NOTE:   this class uses the id key as the primary key for all records
if record includes an id field that is an integer, float
or string, then it will be used as the primary key.
a method to create a new record in the table NOTE : this class uses the id key as the primary key for all records if record includes an id field that is an integer float or string then it will be used as the primary key .
'''
            a method to create a new record in the table 

            NOTE:   this class uses the id key as the primary key for all records
                    if record includes an id field that is an integer, float
                    or string, then it will be used as the primary key. if the id
                    field is missing, a random 64 bit integer (if a number) or a
                    unique 24 character url safe string (if a string) will be 
                    created for the id field and included in the record

            NOTE:   record fields which do not exist in the record_schema or whose
                    value do not match the requirements of the record_schema
                    will throw an InputValidationError

            NOTE:   lists fields are pickled before they are saved to disk and
                    are not possible to search using sql query statements. it is
                    recommended that lists be stored instead as separate tables

            NOTE:   if a map field is declared as empty in the record_schema, then
                    all record fields inside it will be pickled before the
                    record is saved to disk and are not possible to search

        :param record: dictionary with record fields 
        :return: string with id for record
        ''' # validate inputs # prepare record # insert record into table # report and return record id
string with id for record
string with id for record
self
record
dictionary with record fields
dictionary with record fields