4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __DBUTIL_COLLATION_H__
23 #define __DBUTIL_COLLATION_H__
29 #include <db-util-common.h>
37 * @brief Collations Types
39 * These types are intended for use in the
40 * 2nd parameter to the [db_util_create_collation()] interface.
41 * The meanings of the various types is shown below.
44 * Unicode Collation Algorithm / Locale InSensitive / Accent Sensitive / Case Insensitive
45 * This type will be mostly used in 'ORDER BY' clause of sql for sorted list.
47 * [DB_UTIL_COL_LS_AS_CI]
48 * Locale Sensitive / Accent Sensitive / Case Insensitive
49 * This type will be mostly used in 'ORDER BY' clause of sql for sorted list.
51 * [DB_UTIL_COL_LS_AI_CI]
52 * Locale Sensitive / Accent Insensitive / Case Insensitive
53 * This type will be mostly used for '=' operator comparison in 'WHERE' clause.
55 * [DB_UTIL_COL_LS_AI_CI_LC]
56 * Locale Sensitive / Accent Insensitive / Loop Comparison
57 * This type will be mostly used for 'LIKE' operator comparison in 'WHERE' clause.
59 * [DB_UTIL_COL_KR_IC] ##deprecated
60 * Locale Sensitive / Korea / Initial(leading) Consonant
61 * Compares string data using initial(leading) consonant for korea locale.
62 * This type will be mostly used for '=' operator comparison in 'WHERE' clause.
64 * [DB_UTIL_COL_KR_IC_LC] ##deprecated
65 * Locale Sensitive / Korea / Initial(leading) Consonant / Loop Comparison
66 * Compares string data using initial(leading) consonant for korea locale.
67 * This type will be mostly used for 'LIKE' operator comparison in 'WHERE' clause.
71 DB_UTIL_COL_UCA, /**< */
72 DB_UTIL_COL_LS_AS_CI, /**< */
73 DB_UTIL_COL_LS_AI_CI, /**< */
74 DB_UTIL_COL_LS_AI_CI_LC, /**< */
75 DB_UTIL_COL_KO_IC, //deprecated
76 DB_UTIL_COL_KO_IC_LC //deprecated
77 } db_util_collate_type;
80 * @brief Text Encodings
82 * These encodings are intended for use in the
83 * 3rd parameter to the [db_util_create_collation()] interface.
86 DB_UTIL_COL_UTF8 = SQLITE_UTF8, /**< */
87 DB_UTIL_COL_UTF16 = SQLITE_UTF16 /**< */
88 } db_util_collate_textrep;
91 * @brief This function defines a new collating sequences with the database connection specified as the firtst argument.
92 * @remarks This function is needed to be invoked after [db_util_open()].
93 * @param [in] Db connection handle to create collation with
94 * @param [in] Collation type. This value must be one of the [db_util_collate_type]
95 * @param [in] Encoding of text passed to the collating function callback
96 * @param [in] The name of collation(UTF-8 string)
97 * @return This function returns #DB_UTIL_OK or error code on failure
98 * @pre Database connected
101 EXPORT_API int db_util_create_collation(
102 PARAM_IN sqlite3 *db_handle,
103 PARAM_IN db_util_collate_type type,
104 PARAM_IN db_util_collate_textrep text_type,
105 PARAM_IN char* col_name
115 #endif /* __DBUTIL_COLLATION_H__ */