pub struct DelimitedFile<'a> {
pub path_literal: &'a str,
pub directory_literal: &'a str,
pub name: &'a str,
pub columns: &'a [String],
}Expand description
One delimited source file, in every spelling an engine’s file relation may
ask for it in — what
SqlRenderer::delimited_file_relation_for is handed.
One struct rather than four arguments, because a slot that grows an argument is a slot every dialect has to be recompiled for; one that grows a field is not. Each is composed once, by the caller that knows the answer, so no dialect has to take a path apart to find a file name in it.
Fields§
§path_literal: &'a strThe whole path to the file, already a single-quoted SQL string literal and already escaped. Put it where the relation takes a path, and do not quote it again.
directory_literal: &'a strThe directory the file sits in, already a single-quoted SQL string literal — for an engine that resolves a file name against a directory rather than opening a path.
name: &'a strThe file’s own name inside that directory, bare: no quotes and no path in front of it.
columns: &'a [String]The file’s columns, in the order the file writes them, spelled exactly as its header row spells them and with no quoting applied.
Empty where the caller measured no header — a bundle assembled by hand.
An engine that cannot read a file without its columns declared answers
None to an empty list rather than guessing at one.