sqlite3_table_column_metadata() private method

private sqlite3_table_column_metadata ( IntPtr db, byte dbName, byte tblName, byte colName, IntPtr &ptrDataType, IntPtr &ptrCollSeq, int &notNull, int &primaryKey, int &autoInc ) : int
db IntPtr
dbName byte
tblName byte
colName byte
ptrDataType IntPtr
ptrCollSeq IntPtr
notNull int
primaryKey int
autoInc int
return int
Exemplo n.º 1
0
        internal override void ColumnMetaData(string dataBase, string table, string column, out string dataType, out string collateSequence, out bool notNull, out bool primaryKey, out bool autoIncrement)
        {
            IntPtr dataTypePtr;
            IntPtr collSeqPtr;
            int    nnotNull;
            int    nprimaryKey;
            int    nautoInc;
            int    n;
            int    dtLen;
            int    csLen;

#if !SQLITE_STANDARD
            n = UnsafeNativeMethods.sqlite3_table_column_metadata_interop(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc, out dtLen, out csLen);
#else
            dtLen = -1;
            csLen = -1;
            n     = UnsafeNativeMethods.sqlite3_table_column_metadata(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc);
#endif
            if (n > 0)
            {
                throw new SqliteException(n, SQLiteLastError());
            }

            dataType        = UTF8ToString(dataTypePtr, dtLen);
            collateSequence = UTF8ToString(collSeqPtr, csLen);

            notNull       = (nnotNull == 1);
            primaryKey    = (nprimaryKey == 1);
            autoIncrement = (nautoInc == 1);
        }
Exemplo n.º 2
0
        internal override void ColumnMetaData(string dataBase, string table, string column, out string dataType,
                                              out string collateSequence, out bool notNull, out bool primaryKey,
                                              out bool autoIncrement)
        {
            string dataTypePtr = string.Empty;
            string collSeqPtr  = string.Empty;
            int    nnotNull    = 0;
            int    nprimaryKey = 0;
            int    nautoInc    = 0;

            int n = UnsafeNativeMethods.sqlite3_table_column_metadata(_sql, ToUTF8(dataBase), ToUTF8(table),
                                                                      ToUTF8(column), out dataTypePtr, out collSeqPtr,
                                                                      out nnotNull, out nprimaryKey, out nautoInc);

            if (n > 0)
            {
                throw new SqliteException(n, SQLiteLastError());
            }

            dataType        = UTF8ToString(dataTypePtr, -1);
            collateSequence = UTF8ToString(collSeqPtr, -1);

            notNull       = (nnotNull == 1);
            primaryKey    = (nprimaryKey == 1);
            autoIncrement = (nautoInc == 1);
        }