2017-09-21 21:43:27 +02:00
|
|
|
// Copyright (C) 2017 ScyllaDB
|
|
|
|
|
// Use of this source code is governed by a ALv2-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
2017-07-26 10:46:06 +02:00
|
|
|
package gocqlx
|
|
|
|
|
|
|
|
|
|
import (
|
2019-01-25 15:20:53 +01:00
|
|
|
"github.com/scylladb/go-reflectx"
|
2017-07-26 10:46:06 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// DefaultMapper uses `db` tag and automatically converts struct field names to
|
|
|
|
|
// snake case. It can be set to whatever you want, but it is encouraged to be
|
|
|
|
|
// set before gocqlx is used as name-to-field mappings are cached after first
|
|
|
|
|
// use on a type.
|
2020-04-20 17:39:17 +02:00
|
|
|
//
|
|
|
|
|
// A custom mapper can always be set per Sessionm, Query and Iter.
|
2019-01-25 15:20:53 +01:00
|
|
|
var DefaultMapper = reflectx.NewMapperFunc("db", reflectx.CamelToSnakeASCII)
|