Initial commit

This commit is contained in:
2021-08-26 20:59:17 +02:00
commit 3afa4c82ef
524 changed files with 52428 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
namespace OpenDBDiff.Schema.SQLServer.Generates.Generates.Util
{
/// <summary>
/// This class implements a fast conversion from a byte array to an hex string.
/// </summary>
public class ByteToHexEncoder
{
private static readonly uint[] _lookup32 = CreateLookup32();
private static uint[] CreateLookup32()
{
var result = new uint[256];
for (int i = 0; i < 256; i++)
{
var s = i.ToString("X2");
result[i] = ((uint)s[0]) + ((uint)s[1] << 16);
}
return result;
}
public static string ByteArrayToHex(byte[] bytes)
{
var result = new char[2 + bytes.Length * 2];
result[0] = '0';
result[1] = 'x';
for (int i = 0; i < bytes.Length; i++)
{
var val = _lookup32[bytes[i]];
result[2 * i + 2] = (char)val;
result[2 * i + 3] = (char)(val >> 16);
}
return new string(result);
}
}
}

View File

@@ -0,0 +1,28 @@
namespace OpenDBDiff.Schema.SQLServer.Generates.Generates.Util
{
internal class Constants
{
public const int READING_RULES = 0;
public const int READING_TABLES = 1;
public const int READING_CONSTRAINTS = 2;
public const int READING_UDT = 3;
public const int READING_XMLSCHEMAS = 4;
public const int READING_SCHEMAS = 5;
public const int READING_USER = 6;
public const int READING_PARTITIONFUNCTION = 7;
public const int READING_PARTITIONSCHEME = 8;
public const int READING_FILEGROUPS = 9;
public const int READING_DLLTRIGGERS = 10;
public const int READING_SYNONYMS = 11;
public const int READING_ASSEMBLIES = 12;
public const int READING_PROCEDURES = 13;
public const int READING_VIEWS = 14;
public const int READING_FUNCTIONS = 15;
public const int READING_INDEXES = 16;
public const int READING_TRIGGERS = 17;
public const int READING_TEXTOBJECTS = 18;
public const int READING_EXTENDED_PROPERTIES = 19;
public const int READING_MAX = 20;
}
}

View File

@@ -0,0 +1,17 @@
namespace OpenDBDiff.Schema.SQLServer.Generates.Generates.Util
{
internal static class ConvertType
{
public static ObjectType GetObjectType(string type)
{
if (type.Trim().Equals("V")) return ObjectType.View;
if (type.Trim().Equals("U")) return ObjectType.Table;
if (type.Trim().Equals("FN")) return ObjectType.Function;
if (type.Trim().Equals("TF")) return ObjectType.Function;
if (type.Trim().Equals("IF")) return ObjectType.Function;
if (type.Trim().Equals("P")) return ObjectType.StoredProcedure;
if (type.Trim().Equals("TR")) return ObjectType.Trigger;
return ObjectType.None;
}
}
}