Skip to content
Permalink
Browse files

Issue #802: Detect Amazon Redshift via IsRedshift and give servers a …

…fitting icon
  • Loading branch information
ansgarbecker committed Nov 12, 2019
1 parent fe7e402 commit bcd19c390e5f4dfe23c783a76e682993529d3a32
Showing with 95 additions and 8 deletions.
  1. BIN res/icons/server-redshift.png
  2. +18 −8 source/dbconnection.pas
  3. +77 −0 source/main.dfm
Binary file not shown.
@@ -237,6 +237,7 @@ TConnectionParameters = class(TObject)
function IsInfobright: Boolean;
function IsAzure: Boolean;
function IsMemSQL: Boolean;
function IsRedshift: Boolean;
property ImageIndex: Integer read GetImageIndex;
function GetLibraries: TStringList;
function DefaultLibrary: String;
@@ -1365,43 +1366,49 @@ function TConnectionParameters.IsPostgreSQL: Boolean;

function TConnectionParameters.IsMariaDB: Boolean;
begin
Result := Pos('-mariadb', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('-mariadb', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsPercona: Boolean;
begin
Result := Pos('percona server', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('percona server', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsTokudb: Boolean;
begin
Result := Pos('tokudb', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('tokudb', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsInfiniDB: Boolean;
begin
Result := Pos('infinidb', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('infinidb', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsInfobright: Boolean;
begin
Result := Pos('infobright', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('infobright', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsAzure: Boolean;
begin
Result := Pos('azure', LowerCase(ServerVersion)) > 0;
Result := IsMSSQL and (Pos('azure', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsMemSQL: Boolean;
begin
Result := Pos('memsql', LowerCase(ServerVersion)) > 0;
Result := IsMySQL and (Pos('memsql', LowerCase(ServerVersion)) > 0);
end;


function TConnectionParameters.IsRedshift: Boolean;
begin
Result := IsPostgreSQL and (Pos('redshift', LowerCase(ServerVersion)) > 0);
end;


@@ -1423,7 +1430,10 @@ function TConnectionParameters.GetImageIndex: Integer;
Result := 123;
if IsAzure then Result := 188;
end;
ngPgSQL: Result := 187;
ngPgSQL: begin
Result := 187;
if IsRedshift then Result := 195;
end;
else Result := ICONINDEX_SERVER;
end;
end;
@@ -15298,6 +15298,63 @@ object MainForm: TMainForm
0200E02A390400C055720800809BF697FE3F212AC633B6E3CE80000000004945
4E44AE426082}
end>
end
item
Name = 'icons8-redshift'
SourceImages = <
item
Image.Data = {
89504E470D0A1A0A0000000D494844520000006E0000006E0806000000C65B26
FB000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000
00097048597300000EC300000EC301C76FA864000005CF49444154785EEDDD5D
4C1C5514C0F17B0716B02C2C03DBFA55846D69A9692BA536D1440BA50F7D318D
6D227D2868684CAC49A94DC4980251574D8B89C6A7A6BA21464CF4A54D8136F8
A861D7A4F1B1441F6C1B906AAC91CF34B548ECCE1CCF2C77A07CECB2CB0A3307
CEEF0176EE2CFB71FF9DE9DE7D19090082D1A3A9DF8C180E4714A953E5F62317
B326B2C68F65E5E6BF959DA76F50C369F1EBB943BACFFB71C688A7E34270FBBF
6AD8F54884B383E12B6D96429464ADCB1339F9856A6F7AFC4579A2207F9DC069
B8858F7D36E3610C58EBFE80AE0E170B967DA701C06CB182A961B11CE16C5402
BA32DCDC234C0D4F5BCE70B6E9802E3D85BA2ADCD41136864798C0234CCE0B66
5B897036B71E81AE0837134CCE3A25C6B392E16C6E0BE868B85483D99C08679B
0EE8F029D4B1755CA03E74E05ED6F80D0132944A34A74989AF558A50D47FFFC6
E1F3D70EA8E115E7DC021C440DA560735901A569D6A8CD15C7DF9C10C5E188E2
70447138A2381C5169857BE6CD9E8A43E77F2E569B2C4965C7BE2C7EFE744F85
DA5C92252DC04B5E6EDFAF9966ABAFA870FFE6F22DF8C91E7EC5B54D58983202
9ECC48F7EB3B06F061133E70A02ED4869FA94FABCD9438B9007F1080F95167E3
EE66B5B9208936D69FDB9C2132F7E2FC544B01553818B0E62D5FD7BF13609CED
3CF9F4F7EAEE494B3A1CAE5B64E068FB0B20CC56DC78D61AF315EAC27A0173E1
23DE16608685D4C220CD48F7D095EB100C9A6A77CC6A0D278341AD646063B930
0C8C243092A8C6D1C7D4EE69D6BC59F31703F0A329B433DD8D15DFE2DC251564
D170F2C8C58C52CFD84B206433C69B7578C70B37173EC330FE8C08D0C21834F2
D468E54F5FDD0C9D590DE1BA46AEB496F63FB2D33A9A70A80ADF6B151E64EBA7
EE11DFAC7033FAACAFD3B40D372F5DA8AD35D4D88212862BA90F3D2A41F4E20B
D9AA86664936DC3C00E3B70606FF1E1D1A5ED2FF8F6E0937F2D7D0EFBF0D0C7A
F1E6BC028B89136E0AC075F018359DC7F7FCA946E649F8E1040CAD305EB4B448
A97B3C99E43FD444A386F51E528EB62829CBB56866C27F99BC1C208AC311C5E1
88E270447138A2381C511C8E280E471487238AC311C5E188E270447138A2381C
511C8E280E471487238AC311C5E188E270447138A2381C511C8E280E47148723
8AC311C5E188E270447138A2381C511C8E280E471487238AC311C5E188E27044
7138A2381C511C8E280E471487238AC311C5E188E270447138A2381C511C8E28
0E471487238AC311C5E188E270447138A2381C511C8E280E471487238AC311C5
E188E270447138A2381C511C8E280E471487232A61382DDBD30F205A04C0A81A
4A1FC03808E8F96762F2AA1A212BE7A19CABD67BC19BE35323FF079C6B80166F
6E41BF1A5850C270831D0D9383DFBCD6969D931988051430A276250F6008003A
41C8538610953B472AFD9D272A0FDE191B8BA87B90E5D37D91C1AF8F1F1C2CBB
ED079095F85E4FE17027CED5D0D43D523262058BDE9B085C6AAC6CEB68289D54
E30B4AE93AE0DB5EFC226FD26B344A014D42CAA2852E6E8B8FF78794E207095A
D8D032C2DD2776FC824F31EF4956F375C0AD6B7F3F51F7D9931232AAA430ADCB
49EF15523CAE76C73C70715B2BD8A7D189897397DF7EEE6E6C6712967401F76D
AF62C049A351F7EB4D9BB694DDC5571A9642460CE37EB8EB8D3D090F71DB5AB9
80BBC50A59FCCAE79B344356E31F55E36655606B99572FD4530E665B5238DBBE
606F666F705F546DA6642D855B483A736749EB53653A4FBCD6A53B77BC1C208A
C311C5E188E270447138A21C0B670AE8C195489FDAA407E09A04CDFABACB1169
ADE3D22571D55E723474187FBF835BBBD4F0A21C5DC7613010F283AEC65DDD38
738E4D9EA3E16C7640BCF52EDEAE50C3713912CE25C16CAE08678B05AC6B3F84
93F45EA2802B1CAE0FA7E87DB704B3B92A9C6DB1237045C2B9EC089BCB95E16C
F1022E6B380C66027CD87D7277971B83D95C1DCE3637E0328573E529311E12E1
6C76C06C6F4153B6D7B75E0DA7A5A8306F58F7E57E4225988D54383683BF3921
8AC39124C47FAD3246A64AC433DB0000000049454E44AE426082}
end>
end>
Left = 593
Top = 339
@@ -22015,6 +22072,26 @@ object MainForm: TMainForm
0200E02A390400C055720800809BF697FE3F212AC633B6E3CE80000000004945
4E44AE426082}
end>
end
item
Name = 'server-redshift'
SourceImages = <
item
Image.Data = {
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
61000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000
00097048597300000EC300000EC301C76FA8640000013549444154384F636440
032AD113F9FE30B267B2730914B1F3F08B80C4848478DE0809F2F4FE61E798BE
2945F33358211430416938F8F39F6323C37FC68EFF0CFFC51818199940988991
498CE13F4327F38FEF9BA0CAE080452974263F031773B981A9A12850EDC10B27
CE08FFFDF70F2A8D0AFEFEF923AC1035331668B89DBEA9F12B5EA6BF9D4C7F59
FF1B014DAF043A26E5FF7F86C51CDC5CBA50F518E0E7F79FBA0C8C0C8B181919
5380CEAAFACEC26E8CE10552C1A801A3068000D32F1EC693C01C550D4C8D9318
FEFF0BF9FEF5DB05A81C06E0E4E2BCF08F91210498942701937B15D38FEF2730
72A37CF48CDD8C0C8C2E6CDC7C0C1CBC82603111215E06017E2EA01D0C7BD6E7
18BA8205A100C30BBF3E32FAFFFBCF500ACC85CF813A7E81F0BF7FFF9F3330FC
2F61FEF9DD0FAA0C0A1818005DEA5ED628FF60910000000049454E44AE426082}
end>
end>
Left = 689
Top = 339

0 comments on commit bcd19c3

Please sign in to comment.
You can’t perform that action at this time.