Debian Codegraph @

doc/source/reference/types.rst

raw
1 .. -*- rst -*-
2
3 Data types
4 ==========
5
6 Name
7 ----
8
9 Groonga data types
10
11 Description
12 -----------
13
14 Groonga identifies data types to store.
15
16 A primary key of table and column value belong to some kind of data types in Groonga database. And normally, column values become in common with all records in one table.
17
18 A primary key type and column type can be specified Groonga defined types, user defined types or user defined table.
19
20 If you specify other table to primary key type, this table becomes subset of the table of primary key type.
21
22 If you specify other table to column type, this column becomes reference key of the table of column type.
23
24 Builtin types
25 -------------
26
27 The following types are defined as builtin types.
28
29 .. _builtin-type-bool:
30
31 ``Bool``
32 ^^^^^^^^
33
34 Boolean type. The possible values are true and false. (default: false)
35
36 To store a value by :doc:`/reference/commands/load` command, becomes false if you specify false, 0 or empty string, becomes true if you specify others.
37
38 .. _builtin-type-int8:
39
40 ``Int8``
41 ^^^^^^^^
42
43 Signed 8bit integer. It's -128 or more and 127 or less. (default: 0)
44
45 .. _builtin-type-uint8:
46
47 ``UInt8``
48 ^^^^^^^^^
49
50 Unsigned 8bit integer. Is't 0 or more and 255 or less. (default: 0)
51
52 .. _builtin-type-int16:
53
54 ``Int16``
55 ^^^^^^^^^
56
57 Signed 16bit integer. It's -32,768 or more and 32,767 or less. (default: 0)
58
59 .. _builtin-type-uint16:
60
61 ``UInt16``
62 ^^^^^^^^^^
63
64 Unsigned 16bit integer. It's 0 or more and 65,535 or less. (default: 0)
65
66 .. _builtin-type-int32:
67
68 ``Int32``
69 ^^^^^^^^^
70
71 Signed 32bit integer. It's -2,147,483,648 or more and 2,147,483,647 or less. (default: 0)
72
73 .. _builtin-type-uint32:
74
75 ``UInt32``
76 ^^^^^^^^^^
77
78 Unsigned 32bit integer. It's 0 or more and 4,294,967,295 or less. (default: 0)
79
80 .. _builtin-type-int64:
81
82 ``Int64``
83 ^^^^^^^^^
84
85 Signed 64bit integer. It's -9,223,372,036,854,775,808 or more and 9,223,372,036,854,775,807 or less. (default: 0)
86
87 .. _builtin-type-uint64:
88
89 ``UInt64``
90 ^^^^^^^^^^
91
92 Unsigned 64bit integer. It's 0 or more and 18,446,744,073,709,551,615 or less. (default: 0)
93
94 .. _builtin-type-float32:
95
96 ``Float32``
97 ^^^^^^^^^^^
98
99 .. versionadded:: 10.0.2
100
101 Single-precision floating-point number of IEEE 754 as a real number. (default: 0.0)
102
103 See `IEEE floating point - Wikipedia, the free encyclopedia <http://en.wikipedia.org/wiki/IEEE_floating_point>`_ or `IEEE 754: Standard for Binary Floating-Point <http://grouper.ieee.org/groups/754/>`_ for details of IEEE 754 format.
104
105 .. _builtin-type-float:
106
107 ``Float``
108 ^^^^^^^^^
109
110 Double-precision floating-point number of IEEE 754 as a real number. (default: 0.0)
111
112 See `IEEE floating point - Wikipedia, the free encyclopedia <http://en.wikipedia.org/wiki/IEEE_floating_point>`_ or `IEEE 754: Standard for Binary Floating-Point <http://grouper.ieee.org/groups/754/>`_ for details of IEEE 754 format.
113
114 .. _builtin-type-time:
115
116 ``Time``
117 ^^^^^^^^
118
119 Date and Time, the number of seconds that have elapsed since 1970-01-01 00:00:00 by 64 bit signed integer. (default: 0)
120
121 To store a value by :doc:`/reference/commands/load` command, specifies the number of elapsed seconds since 1970-01-01 00:00:00. To specify the detailed date and time than seconds, use the decimal.
122
123 .. _builtin-type-short-text:
124
125 ``ShortText``
126 ^^^^^^^^^^^^^
127
128 String of 4,095 or less bytes. (default: "")
129
130 .. _builtin-type-text:
131
132 ``Text``
133 ^^^^^^^^
134
135 String of 65,535 or less bytes. (default: "")
136
137 .. _builtin-type-long-text:
138
139 ``LongText``
140 ^^^^^^^^^^^^
141
142 String of 2,147,483,647 or less bytes. (default: "")
143
144 .. _builtin-type-tokyo-geo-point:
145
146 ``TokyoGeoPoint``
147 ^^^^^^^^^^^^^^^^^
148
149 旧日本測地系による経緯度であり、経度と緯度をミリ秒単位で表現した整数の組により表現します。(デフォルト値: 0x0)
150
151 度分秒形式でx度y分z秒となる経度・緯度は、(((x * 60) + y) * 60 + z) * 1000という計算式でミリ秒単位へと変換されます。
152
153 :doc:`/reference/commands/load` コマンドで値を格納するときは、"ミリ秒単位の経度xミリ秒単位の緯度" もしくは "経度の小数表記x緯度の小数表記" という文字列表現を使って指定します。経度と緯度の区切りとしては、'x' のほかに ',' を使うことができます。
154
155 測地系の詳細については、 `測地系 - Wikipedia <http://ja.wikipedia.org/wiki/%E6%B8%AC%E5%9C%B0%E7%B3%BB>`_ を参照してください。
156
157 .. _builtin-type-wgs84-geo-point:
158
159 ``WGS84GeoPoint``
160 ^^^^^^^^^^^^^^^^^
161
162 世界測地系(World Geodetic System, WGS 84)による経緯度であり、経度と緯度をミリ秒単位で表現した整数の組により表現します。(デフォルト値: 0x0)
163
164 度分秒形式からミリ秒形式への変換方法や :doc:`/reference/commands/load` コマンドにおける指定方法はTokyoGeoPointと同じです。
165
166 .. _builtin-type-short-binary:
167
168 ``ShortBinary``
169 ^^^^^^^^^^^^^^^
170
171 .. versionadded:: 15.1.8
172
173 .. note::
174
175 This is an experimental feature. Currently, this feature is still not stable.
176
177 Binary of 4,095 or less bytes. (default: "")
178
179 .. _builtin-type-binary:
180
181 ``Binary``
182 ^^^^^^^^^^
183
184 .. versionadded:: 15.1.8
185
186 .. note::
187
188 This is an experimental feature. Currently, this feature is still not stable.
189
190 Binary of 65,535 or less bytes. (default: "")
191
192 .. _builtin-type-long-binary:
193
194 ``LongBinary``
195 ^^^^^^^^^^^^^^
196
197 .. versionadded:: 15.1.8
198
199 .. note::
200
201 This is an experimental feature. Currently, this feature is still not stable.
202
203 Binary of 2,147,483,647 or less bytes. (default: "")
204
205 Limitations about types
206 -----------------------
207
208 Types that can't be specified in primary key of table
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
211 ``Text`` and ``LongText`` can't be specified in primary key of table.
212
213 ベクターとして格納できない型
214 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
215
216 Groongaのカラムは、ある型のベクターを保存することができます。しかし、ShortText, Text, LongTextの3つの型についてはベクターとして保存したり出力したりすることはできますが、検索条件やドリルダウン条件に指定することができません。
217
218 テーブル型は、ベクターとして格納することができます。よって、ShortTextのベクターを検索条件やドリルダウン条件に使用したい場合には、主キーがShortText型のテーブルを別途作成し、そのテーブルを型として利用します。