MCPcopy Create free account
hub / github.com/TankHQ/tank / write_copy

Method write_copy

tank-postgres/src/sql_writer.rs:13–32  ·  view source on GitHub ↗

Write COPY FROM STDIN BINARY.

(&self, out: &mut DynQuery)

Source from the content-addressed store, hash-verified

11impl PostgresSqlWriter {
12 /// Write COPY FROM STDIN BINARY.
13 pub fn write_copy<E>(&self, out: &mut DynQuery)
14 where
15 Self: Sized,
16 E: Entity,
17 {
18 out.buffer().reserve(128);
19 out.push_str("COPY ");
20 let mut context = Context::new(Default::default(), E::qualified_columns());
21 self.write_table_ref(&mut context, out, E::table());
22 out.push_str(" (");
23 separated_by(
24 out,
25 E::columns().iter(),
26 |out, col| {
27 self.write_identifier(&mut context, out, col.name(), true);
28 },
29 ", ",
30 );
31 out.push_str(") FROM STDIN BINARY;");
32 }
33}
34
35impl SqlWriter for PostgresSqlWriter {

Callers

nothing calls this directly

Calls 6

separated_byFunction · 0.85
bufferMethod · 0.80
push_strMethod · 0.80
write_table_refMethod · 0.45
write_identifierMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected