@@ -39,7 +39,9 @@ pub use schema::{Field, FieldDisplay, FieldLike, Schema, test_utils as schema_te
3939use crate :: array:: DataChunk ;
4040pub use crate :: constants:: hummock;
4141use crate :: error:: BoxedError ;
42- pub use crate :: id:: { DatabaseId , SchemaId , TableId } ;
42+ pub use crate :: id:: {
43+ ConnectionId , DatabaseId , FunctionId , IndexId , ObjectId , SchemaId , SecretId , TableId ,
44+ } ;
4345
4446/// The global version of the catalog.
4547pub type CatalogVersion = u64 ;
@@ -148,8 +150,6 @@ pub trait SysCatalogReader: Sync + Send + 'static {
148150
149151pub type SysCatalogReaderRef = Arc < dyn SysCatalogReader > ;
150152
151- pub type ObjectId = u32 ;
152-
153153#[ derive( Clone , Debug , PartialEq , Default , Copy ) ]
154154pub struct TableOption {
155155 pub retention_seconds : Option < u32 > , // second
@@ -178,75 +178,6 @@ impl TableOption {
178178 }
179179}
180180
181- #[ derive( Clone , Copy , Debug , Display , Default , Hash , PartialOrd , PartialEq , Eq ) ]
182- #[ display( "{index_id}" ) ]
183- pub struct IndexId {
184- pub index_id : u32 ,
185- }
186-
187- impl IndexId {
188- pub const fn new ( index_id : u32 ) -> Self {
189- IndexId { index_id }
190- }
191-
192- /// Sometimes the id field is filled later, we use this value for better debugging.
193- pub const fn placeholder ( ) -> Self {
194- IndexId {
195- index_id : OBJECT_ID_PLACEHOLDER ,
196- }
197- }
198-
199- pub fn index_id ( & self ) -> u32 {
200- self . index_id
201- }
202- }
203-
204- impl From < u32 > for IndexId {
205- fn from ( id : u32 ) -> Self {
206- Self :: new ( id)
207- }
208- }
209- impl From < IndexId > for u32 {
210- fn from ( id : IndexId ) -> Self {
211- id. index_id
212- }
213- }
214-
215- #[ derive( Clone , Copy , Debug , Display , Default , Hash , PartialOrd , PartialEq , Eq , Ord ) ]
216- pub struct FunctionId ( pub u32 ) ;
217-
218- impl FunctionId {
219- pub const fn new ( id : u32 ) -> Self {
220- FunctionId ( id)
221- }
222-
223- pub const fn placeholder ( ) -> Self {
224- FunctionId ( OBJECT_ID_PLACEHOLDER )
225- }
226-
227- pub fn function_id ( & self ) -> u32 {
228- self . 0
229- }
230- }
231-
232- impl From < u32 > for FunctionId {
233- fn from ( id : u32 ) -> Self {
234- Self :: new ( id)
235- }
236- }
237-
238- impl From < & u32 > for FunctionId {
239- fn from ( id : & u32 ) -> Self {
240- Self :: new ( * id)
241- }
242- }
243-
244- impl From < FunctionId > for u32 {
245- fn from ( id : FunctionId ) -> Self {
246- id. 0
247- }
248- }
249-
250181#[ derive( Clone , Copy , Debug , Display , Default , Hash , PartialOrd , PartialEq , Eq , Ord ) ]
251182#[ display( "{user_id}" ) ]
252183pub struct UserId {
@@ -283,76 +214,6 @@ impl From<UserId> for u32 {
283214 }
284215}
285216
286- #[ derive( Clone , Copy , Debug , Display , Default , Hash , PartialOrd , PartialEq , Eq , Ord ) ]
287- pub struct ConnectionId ( pub u32 ) ;
288-
289- impl ConnectionId {
290- pub const fn new ( id : u32 ) -> Self {
291- ConnectionId ( id)
292- }
293-
294- pub const fn placeholder ( ) -> Self {
295- ConnectionId ( OBJECT_ID_PLACEHOLDER )
296- }
297-
298- pub fn connection_id ( & self ) -> u32 {
299- self . 0
300- }
301- }
302-
303- impl From < u32 > for ConnectionId {
304- fn from ( id : u32 ) -> Self {
305- Self :: new ( id)
306- }
307- }
308-
309- impl From < & u32 > for ConnectionId {
310- fn from ( id : & u32 ) -> Self {
311- Self :: new ( * id)
312- }
313- }
314-
315- impl From < ConnectionId > for u32 {
316- fn from ( id : ConnectionId ) -> Self {
317- id. 0
318- }
319- }
320-
321- #[ derive( Clone , Copy , Debug , Display , Default , Hash , PartialOrd , PartialEq , Eq , Ord ) ]
322- pub struct SecretId ( pub u32 ) ;
323-
324- impl SecretId {
325- pub const fn new ( id : u32 ) -> Self {
326- SecretId ( id)
327- }
328-
329- pub const fn placeholder ( ) -> Self {
330- SecretId ( OBJECT_ID_PLACEHOLDER )
331- }
332-
333- pub fn secret_id ( & self ) -> u32 {
334- self . 0
335- }
336- }
337-
338- impl From < u32 > for SecretId {
339- fn from ( id : u32 ) -> Self {
340- Self :: new ( id)
341- }
342- }
343-
344- impl From < & u32 > for SecretId {
345- fn from ( id : & u32 ) -> Self {
346- Self :: new ( * id)
347- }
348- }
349-
350- impl From < SecretId > for u32 {
351- fn from ( id : SecretId ) -> Self {
352- id. 0
353- }
354- }
355-
356217#[ derive( Default , Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
357218pub enum ConflictBehavior {
358219 #[ default]
0 commit comments