def METHOD_NAME(
    repository,
    table,
    file,
    replace,
    primary_key,
    override_type,
    encoding,
    separator,
    no_header,
    skip_schema_check,
    ignore_empty_strings,
):
    """
    Import a CSV file into a checked-out Splitgraph repository. This doesn't create a new image, use `sgr commit`
    after the import and any adjustments (e.g. adding primary keys or converting column types) to do so.
    If the target table doesn't exist, this will create a new table.
    If the target table does exist, this will try and patch the new values in by updating rows that exist in the
    current table (as per its primary key constraints) and inserting new ones. Rows existing in the current table
    but missing in the CSV won't be deleted.
    If `-r` is passed, the table will instead be deleted and recreated from the CSV file if it exists.
    """
    import csv
    from splitgraph.ingestion.csv import csv_adapter
    from splitgraph.ingestion.inference import infer_sg_schema
    if not primary_key:
        click.echo(
            "Warning: primary key is not specified, using the whole row as primary key."
            "This is probably not something that you want."
        )
    stream = ResettableStream(file)
    reader = csv.reader(io.TextIOWrapper(io.BufferedReader(stream)), delimiter=separator or ",")
    # Grab the first few rows from the CSV and give them to TableSchema.
    sample = list(islice(reader, 100))
    if no_header:
        # Patch in a dummy header
        sample = [[str(i) for i in range(len(sample))]] + sample
    type_overrides = dict(override_type or [])
    sg_schema = infer_sg_schema(
        sample,
        override_types=type_overrides,
        primary_keys=primary_key,
        ignore_empty_strings=ignore_empty_strings,
    )
    logging.debug("Using Splitgraph schema: %r", sg_schema)
    # Reset the stream and pass it to COPY FROM STDIN
    stream.reset()
    csv_adapter.to_table(
        io.TextIOWrapper(io.BufferedReader(stream)),
        repository,
        table,
        if_exists="replace" if replace else "patch",
        schema_check=not skip_schema_check,
        no_header=no_header,
        delimiter=separator,
        encoding=encoding,
        schema_spec=sg_schema,
    )