@@ -24,6 +24,7 @@ pub type Oid = u32;
2424static BOOLOID : Oid = 16 ;
2525static BYTEAOID : Oid = 17 ;
2626static CHAROID : Oid = 18 ;
27+ static NAMEOID : Oid = 19 ;
2728static INT8OID : Oid = 20 ;
2829static INT2OID : Oid = 21 ;
2930static INT4OID : Oid = 23 ;
@@ -35,6 +36,7 @@ static FLOAT8OID: Oid = 701;
3536static BOOLARRAYOID : Oid = 1000 ;
3637static BYTEAARRAYOID : Oid = 1001 ;
3738static CHARARRAYOID : Oid = 1002 ;
39+ static NAMEARRAYOID : Oid = 1003 ;
3840static INT2ARRAYOID : Oid = 1005 ;
3941static INT4ARRAYOID : Oid = 1007 ;
4042static TEXTARRAYOID : Oid = 1009 ;
@@ -136,6 +138,8 @@ make_postgres_type!(
136138 BYTEAOID => PgByteA ,
137139 #[ doc="\" char\" " ]
138140 CHAROID => PgChar ,
141+ #[ doc="NAME" ]
142+ NAMEOID => PgName ,
139143 #[ doc="INT8/BIGINT" ]
140144 INT8OID => PgInt8 ,
141145 #[ doc="INT2/SMALLINT" ]
@@ -158,6 +162,8 @@ make_postgres_type!(
158162 BYTEAARRAYOID => PgByteAArray member PgByteA ,
159163 #[ doc="\" char\" []" ]
160164 CHARARRAYOID => PgCharArray member PgChar ,
165+ #[ doc="NAME[]" ]
166+ NAMEARRAYOID => PgNameArray member PgName ,
161167 #[ doc="INT2[]" ]
162168 INT2ARRAYOID => PgInt2Array member PgInt2 ,
163169 #[ doc="INT4[]" ]
@@ -392,7 +398,7 @@ macro_rules! from_raw_from_impl(
392398
393399from_raw_from_impl ! ( PgBool , bool )
394400from_raw_from_impl ! ( PgByteA , Vec <u8 >)
395- from_raw_from_impl ! ( PgVarchar | PgText | PgCharN , ~str )
401+ from_raw_from_impl ! ( PgVarchar | PgText | PgCharN | PgName , ~str )
396402from_raw_from_impl ! ( PgChar , i8 )
397403from_raw_from_impl ! ( PgInt2 , i16 )
398404from_raw_from_impl ! ( PgInt4 , i32 )
@@ -447,7 +453,7 @@ from_array_impl!(PgByteAArray, Vec<u8>)
447453from_array_impl ! ( PgCharArray , i8 )
448454from_array_impl ! ( PgInt2Array , i16 )
449455from_array_impl ! ( PgInt4Array , i32 )
450- from_array_impl ! ( PgTextArray | PgCharNArray | PgVarcharArray , ~str )
456+ from_array_impl ! ( PgTextArray | PgCharNArray | PgVarcharArray | PgNameArray , ~str )
451457from_array_impl ! ( PgInt8Array , i64 )
452458from_array_impl ! ( PgTimestampArray | PgTimestampTZArray , Timespec )
453459from_array_impl ! ( PgJsonArray , Json )
@@ -684,7 +690,7 @@ macro_rules! to_raw_to_impl(
684690
685691to_raw_to_impl ! ( PgBool , bool )
686692to_raw_to_impl ! ( PgByteA , Vec <u8 >)
687- to_raw_to_impl ! ( PgVarchar | PgText | PgCharN , ~str )
693+ to_raw_to_impl ! ( PgVarchar | PgText | PgCharN | PgName , ~str )
688694to_raw_to_impl ! ( PgJson , Json )
689695to_raw_to_impl ! ( PgChar , i8 )
690696to_raw_to_impl ! ( PgInt2 , i16 )
@@ -699,12 +705,12 @@ to_raw_to_impl!(PgTsRange | PgTstzRange, Range<Timespec>)
699705impl < ' a > ToSql for & ' a str {
700706 fn to_sql ( & self , ty : & PostgresType )
701707 -> PostgresResult < ( Format , Option < Vec < u8 > > ) > {
702- check_types ! ( PgVarchar | PgText | PgCharN , ty)
708+ check_types ! ( PgVarchar | PgText | PgCharN | PgName , ty)
703709 Ok ( ( Text , Some ( Vec :: from_slice ( self . as_bytes ( ) ) ) ) )
704710 }
705711}
706712
707- to_option_impl_lifetime ! ( PgVarchar | PgText | PgCharN , & ' a str )
713+ to_option_impl_lifetime ! ( PgVarchar | PgText | PgCharN | PgName , & ' a str )
708714
709715impl < ' a > ToSql for & ' a [ u8 ] {
710716 fn to_sql ( & self , ty : & PostgresType )
@@ -762,7 +768,7 @@ to_array_impl!(PgByteAArray, Vec<u8>)
762768to_array_impl ! ( PgCharArray , i8 )
763769to_array_impl ! ( PgInt2Array , i16 )
764770to_array_impl ! ( PgInt4Array , i32 )
765- to_array_impl ! ( PgTextArray | PgCharNArray | PgVarcharArray , ~str )
771+ to_array_impl ! ( PgTextArray | PgCharNArray | PgVarcharArray | PgNameArray , ~str )
766772to_array_impl ! ( PgInt8Array , i64 )
767773to_array_impl ! ( PgTimestampArray | PgTimestampTZArray , Timespec )
768774to_array_impl ! ( PgFloat4Array , f32 )
0 commit comments