INNER CODE UNIT · Rust

Some

stepancheg/rust-protobuf · protobuf-examples/issue-614/src/lib.rs:33

            if let Some(oneof) = field.containing_oneof() {
                column_names.push(format!("{}_type", oneof.name()));
                column_values.push(format!("'{}'", field.name()));
                column_names.push(format!("{}_value", oneof.name()));
                column_values.push(format!("'{}'", v));
            } else {
                column_names.push(field.name().to_owned());
                column_values.push(format!("'{}'", v));
            }
        }
    }
    let column_names = column_names.join(", ");
    let column_values = column_values.join(", ");
    format!("INSERT INTO {table}({column_names}) VALUES ({column_values})")
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…