You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: utils.go
    path of file: ./repos/rill/runtime/drivers/duckdb
    
    the code of the file until where you have to start completion: package duckdb

import (
	"database/sql"
	"database/sql/driver"
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com
    
func parseFileSourceProperties(props map[string]any) (*fileSourceProperties, error) {
	cfg := &fileSourceProperties{}
	if err := mapstructure.Decode(props, cfg); err != nil {
		return nil, fmt.Errorf("failed to parse source properties: %w", err)
	}

	if cfg.DuckDB == nil {
		cfg.DuckDB = map[string]any{}
	}

	if cfg.HivePartitioning != nil {
		cfg.DuckDB["hive_partitioning"] = *cfg.HivePartitioning
		cfg.HivePartitioning = nil
	}

	if cfg.CSVDelimiter != "" {
		cfg.DuckDB["delim"] = fmt.Sprintf("'%v'", cfg.CSVDelimiter)
		cfg.CSVDelimiter = ""
	}

	if cfg.IngestAllowSchemaRelaxation != nil {
		cfg.AllowSchemaRelaxation = *cfg.IngestAllowSchemaRelaxation
		cfg.IngestAllowSchemaRelaxation = nil
	}

	if cfg.AllowSchemaRelaxation {
		if val, ok := cfg.DuckDB["union_by_name"].(bool); ok && !val {
			return nil, fmt.Errorf("can't set `union_by_name` and `allow_schema_relaxation` at the same time")
		}

		if hasKey(cfg.DuckDB, "columns", "types", "dtypes") {
			return nil, fmt.Errorf("if any of `columns`,`types`,`dtypes` is set `allow_schema_relaxation` must be disabled")
		}
	}
	return cfg, nil
}