|
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- syntax = "proto3";
- package parser;
- import "google/protobuf/any.proto";
-
- option go_package=".;parser";
-
- message BranchUndoLog {
- string Xid = 1;
- uint64 BranchID = 2;
- repeated SQLUndoLog Logs = 3;
- }
-
- message SQLUndoLog {
- SQLType SQLType = 1;
- string TableName = 2;
- RecordImage BeforeImage = 3;
- RecordImage AfterImage = 4;
- }
-
- message RecordImage {
- int32 index = 1;
- string TableName = 2;
- SQLType SQLType = 3;
- repeated RowImage Rows = 4;
- TableMeta TableMeta = 5;
- }
-
- message RowImage {
- repeated ColumnImage Columns = 1;
- }
-
- message ColumnImage {
- IndexType KeyType = 1;
- string ColumnName = 2;
- JDBCType ColumnType = 3;
- google.protobuf.Any Value = 4;
- }
-
- message TableMeta {
- string TableName = 1;
- map<string, ColumnMeta> Columns = 2;
- map<string, IndexMeta> Indexs = 3;
- repeated string ColumnNames = 4;
- }
-
- message ColumnMeta {
- string Schema = 1;
- string Table = 2;
- bytes ColumnDef = 3;
- bool Autoincrement = 4;
- string ColumnName = 5;
- string ColumnType = 6;
- int32 DatabaseType = 7;
- string DatabaseTypeString = 8;
- string ColumnKey = 9;
- int32 IsNullable = 10;
- string Extra = 11;
- }
-
- message IndexMeta {
- string Schema = 1;
- string Table = 2;
- string Name = 3;
- string ColumnName = 4;
- IndexType IType = 5;
- repeated ColumnMeta Columns = 6;
- }
-
- enum IndexType {
- IndexTypeNull = 0;
- IndexTypePrimaryKey = 1;
- }
-
- enum JDBCType {
- JDBCTypeNull = 0;
- JDBCTypeBit = -7;
- JDBCTypeTinyInt = -6;
- JDBCTypeSmallInt = 5;
- JDBCTypeInteger = 4;
- JDBCTypeBigInt = -5;
- JDBCTypeFloat = 6;
- JDBCTypeReal = 7;
- JDBCTypeDouble = 8;
- JDBCTypeNumberic = 2;
- JDBCTypeDecimal = 3;
- JDBCTypeChar = 1;
- JDBCTypeVarchar = 12;
- JDBCTypeLongVarchar = -1;
- JDBCTypeDate = 91;
- JDBCTypeTime = 92;
- JDBCTypeTimestamp = 93;
- JDBCTypeBinary = -2;
- JDBCTypeVarBinary = -3;
- JDBCTypeLongVarBinary = -4;
- JDBCTypeOther = 1111;
- JDBCTypeJavaObject = 2000;
- JDBCTypeDistinct = 2001;
- JDBCTypeStruct = 2002;
- JDBCTypeArray = 2003;
- JDBCTypeBlob = 2004;
- JDBCTypeClob = 2005;
- JDBCTypeRef = 2006;
- JDBCTypeDateLink = 70;
- JDBCTypeBoolean = 16;
- JDBCTypeRowID = -8;
- JDBCTypeNchar = -15;
- JDBCTypeNvarchar = -9;
- JDBCTypeLongNvVarchar = -16;
- JDBCTypeNclob = 2011;
- JDBCTypeSqlXML = 2009;
- JDBCTypeRefCursor = 2012;
- JDBCTypeTimeWithTimeZone = 2013;
- JDBCTypeTimestampWithTimezone = 2014;
- }
-
- enum SQLType {
- SQLTypeSelect = 0;
- SQLTypeInsert = 1;
- SQLTypeUpdate = 2;
- SQLTypeDelete = 3;
- SQLTypeSelectForUpdate = 4;
- SQLTypeReplace = 5;
- SQLTypeTruncate = 6;
- SQLTypeCreate = 7;
- SQLTypeDrop = 8;
- SQLTypeLoad = 9;
- SQLTypeMerge = 10;
- SQLTypeShow = 11;
- SQLTypeAlter = 12;
- SQLTypeRename = 13;
- SQLTypeDump = 14;
- SQLTypeDebug = 15;
- SQLTypeExplain = 16;
- SQLTypeProcedure = 17;
- SQLTypeDesc = 18;
- SQLLastInsertID = 19;
- SQLSelectWithoutTable = 20;
- SQLCreateSequence = 21;
- SQLShowSequence = 22;
- SQLGetSequence = 23;
- SQLAlterSequence = 24;
- SQLDropSequence = 25;
- SQLTddlShow = 26;
- SQLTypeSet = 27;
- SQLTypeReload = 28;
- SQLTypeSelectUnion = 29;
- SQLTypeCreateTable = 30;
- SQLTypeDropTable = 31;
- SQLTypeAlterTable = 32;
- SQLTypeSavePoint = 33;
- SQLTypeSelectFromUpdate = 34;
- SQLTypeMultiDelete = 35;
- SQLTypeMultiUpdate = 36;
- SQLTypeCreateIndex = 37;
- SQLTypeDropIndex = 38;
- SQLTypeKill = 39;
- SQLTypeLockTables = 40;
- SQLTypeUnLockTables = 41;
- SQLTypeCheckTable = 42;
- SQLTypeSelectFoundRows = 43;
- SQLTypeInsertIgnore = 101; // Adjusted the value to match Go's logic
- SQLTypeInsertOnDuplicateUpdate = 102;
- SQLTypeMulti = 1044; // Adjusted the value to match Go's logic
- SQLTypeUnknown = 1045;
- }
|