IDL modifications request



Hi!

I'm in the process of updating the Postgres provider, and I think we should
modify the IDL for date/times data types:
1) The struct DbTime would need an information about the timezone (if the
information is given)
2) The same for struct DbTimestamp.
3) A new type would be nice: to store intervals: from a date/time to another.

So here is the new IDL I propose:
module GDA {
	  enum ValueType {
		TypeNull,    TypeBigint, TypeBinary,
		TypeBoolean, TypeBstr,   TypeChar,
		TypeCurrency,TypeDate,   TypeDbDate,
		TypeDbTime,  TypeDbTimestamp, TypeDecimal,
NEW -->	TypeDbTimeInterval, 
		TypeDouble,  TypeError,  TypeInteger,
		TypeLongvarbin, TypeLongvarchar, TypeLongvarwchar,
		TypeNumeric, TypeSingle, TypeSmallint,
		TypeTinyint, TypeUBigint, TypeUSmallint,
		TypeVarchar, TypeVarbin,  TypeVarwchar,
		TypeFixchar, TypeFixbin,  TypeFixwchar,
		TypeUnknown, TypeLastValue
	  };
	enum LockType{
		LOCK_READONLY,
		LOCK_PESSIMISTIC,
		LOCK_OPTIMISTIC,
		LOCK_BATCH
	};
	enum CursorType
	{
		OPEN_FWDONLY,
		OPEN_KEYSET,
		OPEN_DYNAMIC,
		OPEN_STATIC
	};

	const unsigned long CMD_NORECORDS=0x80000000;
	enum CommandType
	{
		CMD_TEXT1,
		CMD_TABLE,
		CMD_TABLEDIRECT,
		CMD_STOREDPROCEDURE,
		CMD_FILE
	};
	
	enum Option{
		ADD_NEW,
		APPROX_POS,
		BOOKMARK,
		DELETE,
		HOLD_RECS,
		MOVE_PREV,
		DO_RESYNC,
		DO_UPDATE,
		UPDATE_BATCH
	};
	enum AffectedRows
	{
		GDR_AFFECT_CURRENT,
		GDR_AFFECT_GROUP,
		GDR_AFFECT_ALL
	};

	enum CursorLocation {
		USE_CLIENT_CURSOR,
		USE_SERVER_CURSOR
	};

	enum IsolationLevel {
		IL_UNSPECIFIED,
		IL_CHAOS,
		IL_BROWSE,
		IL_READ_COMMITED,
		IL_READ_INCOMMTED,
		IL_READ_REPEATED,
		IL_READ_SERIALIZABLE
	};
	enum ParameterDirection {
		PARAM_IN,
		PARAM_OUT,
		PARAM_INOUT
	};
	typedef long Date;

	struct  DbDate{
		short year;
		unsigned short month;
		unsigned short day;
	};
	struct DbTime {
		unsigned short hour;
		unsigned short minute;
		unsigned short second;
-->		boolean        with_zone;
-->		string<4>      zone;
	};
	struct DbTimestamp {
		short year;
		unsigned short month;
		unsigned short day;
		unsigned short hour;
		unsigned short minute;
		unsigned short second;
		unsigned long  fraction;
-->		boolean        with_zone;
-->		string<4>      zone;
	};
-->	struct DbTimeInterval {
		DbTimestamp from;
		DbTimestamp to;
	};
	typedef sequence<octet> VarBinString; 

	union Value switch (ValueType) {
	case TypeTinyint:
		char c;
	case TypeBigint:
		long long ll;
	case TypeBoolean:
		boolean b;
	case TypeDate:
		Date d;
	case TypeDbDate:
		DbDate dbd;
	case TypeDbTime:
		DbTime dbt;
	case TypeDbTimestamp:
		DbTimestamp dbtstamp;
-->	case TypeDbTimeInterval:
		TypeDbTimeInterval dbtinterval;
	case TypeDouble:
		double dp;    
		/* case TypeError: NYI */
	case TypeInteger:
		long i;
	case TypeBinary:
	case TypeVarbin:
	case TypeVarwchar:
	case TypeLongvarwchar:
	case TypeLongvarbin:
	case TypeUnknown:
		VarBinString lvb;
	case TypeFixbin:
	case TypeFixwchar:
	case TypeFixchar:
		VarBinString fb;
	case TypeCurrency:
	case TypeDecimal:
	case TypeNumeric:
	case TypeChar:
	case TypeVarchar:
	case TypeLongvarchar:
		string  lvc;
	case TypeSingle:
		float  f;
	case TypeSmallint:
		short  si;
	case TypeUBigint:
		unsigned long long ull;
	case TypeUSmallint:
		unsigned short us;
	};

(...)

Tell me what you think of all this.

Cheers,

Vivien.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]