function objectToSql(obj) {
    const arr = [];

    for(var key in obj) {

        let element = obj[key];

        if (Object.hasOwnProperty.call(obj, key)) {
            if (typeof value === "string" && element.indexOf(" ") >=0) {
                element = "'" + element + "'"; 
            }

            arr.push(key + "=" + element);
        }
    }

    return arr.toString();
}
// Convert key value pairs to SQL
Convert key value pairs to SQL
Convert key value pairs to SQL
function objectToSql(obj) {
    const arr = [];
    for(var key in obj) {
        let element = obj[key];
        if (Object.hasOwnProperty.call(obj, key)) {
            if (typeof value === "string" && element.indexOf(" ") >=0) {
                element = "'" + element + "'"; 
            }
            arr.push(key + "=" + element);
        }
    }
    return arr.toString();
}
function objectToSql ( obj ) { const arr = [ ] ; for ( var key in obj ) { let element = obj [ key ] ; if ( Object . hasOwnProperty . call ( obj , key ) ) { if ( typeof value === "string" && element . indexOf ( " " ) >= 0 ) { element = "'" + element + "'" ; } arr . push ( key + "=" + element ) ; } } return arr . toString ( ) ; }
Convert key value pairs to SQL
Convert key value pairs to SQL