Skip to content

Commit 6a584e8

Browse files
committed
spaces -> tabs
1 parent bbdabf3 commit 6a584e8

File tree

14 files changed

+5189
-5189
lines changed

14 files changed

+5189
-5189
lines changed

source/app.d

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,98 +2,98 @@
22
Usage: app [connection string]
33
44
If connection string isn't provided, the following default connection string will be used:
5-
host=localhost;port=3306;user=testuser;pwd=testpassword;db=testdb
5+
host=localhost;port=3306;user=testuser;pwd=testpassword;db=testdb
66
77
(optional) -version=Have_vibe_d_core:
8-
Link with Vibe.d, and run test using use Vibe.d sockets instead of Phobos sockets.
8+
Link with Vibe.d, and run test using use Vibe.d sockets instead of Phobos sockets.
99
1010
(optional) -version=UseConnPool:
11-
Run test using use Vibe.d conenction pool. Requires -version=Have_vibe_d_core
11+
Run test using use Vibe.d conenction pool. Requires -version=Have_vibe_d_core
1212
+/
1313

1414
import mysql.connection;
1515
import std.stdio;
1616

1717
void main(string[] args)
1818
{
19-
string connStr = "host=localhost;port=3306;user=testuser;pwd=testpassword;db=testdb";
20-
if(args.length > 1)
21-
connStr = args[1];
22-
else
23-
writeln("No connection string provided on cmdline, using default:\n", connStr);
24-
25-
try testMySql(connStr);
26-
catch( Exception e ){
27-
writeln("Failed: ", e.toString());
28-
}
19+
string connStr = "host=localhost;port=3306;user=testuser;pwd=testpassword;db=testdb";
20+
if(args.length > 1)
21+
connStr = args[1];
22+
else
23+
writeln("No connection string provided on cmdline, using default:\n", connStr);
24+
25+
try testMySql(connStr);
26+
catch( Exception e ){
27+
writeln("Failed: ", e.toString());
28+
}
2929
}
3030

3131
void testMySql(string connStr)
3232
{
33-
version(UseConnPool)
34-
{
35-
import mysql.db;
36-
auto mdb = new MysqlDB(connStr);
37-
auto c = mdb.lockConnection();
38-
scope(exit) c.close();
39-
}
40-
else
41-
{
42-
auto c = new Connection(connStr);
43-
scope(exit) c.close();
44-
}
33+
version(UseConnPool)
34+
{
35+
import mysql.db;
36+
auto mdb = new MysqlDB(connStr);
37+
auto c = mdb.lockConnection();
38+
scope(exit) c.close();
39+
}
40+
else
41+
{
42+
auto c = new Connection(connStr);
43+
scope(exit) c.close();
44+
}
4545

4646
// writefln("You have connected to server version %s", c.serverVersion);
4747
// writefln("With currents stats : %s", c.serverStats());
48-
auto caps = c.serverCapabilities;
49-
writefln("MySQL Server %s with capabilities (%b):", c.serverVersion, caps);
50-
if(caps && SvrCapFlags.OLD_LONG_PASSWORD)
51-
writeln("\tLong passwords");
52-
if(caps && SvrCapFlags.FOUND_NOT_AFFECTED)
53-
writeln("\tReport rows found rather than rows affected");
54-
if(caps && SvrCapFlags.ALL_COLUMN_FLAGS)
55-
writeln("\tSend all column flags");
56-
if(caps && SvrCapFlags.WITH_DB)
57-
writeln("\tCan take database as part of login");
58-
if(caps && SvrCapFlags.NO_SCHEMA)
59-
writeln("\tCan disallow database name as part of column name database.table.column");
60-
if(caps && SvrCapFlags.CAN_COMPRESS)
61-
writeln("\tCan compress packets");
62-
if(caps && SvrCapFlags.ODBC)
63-
writeln("\tCan handle ODBC");
64-
if(caps && SvrCapFlags.LOCAL_FILES)
65-
writeln("\tCan use LOAD DATA LOCAL");
66-
if(caps && SvrCapFlags.IGNORE_SPACE)
67-
writeln("\tCan ignore spaces before '('");
68-
if(caps && SvrCapFlags.PROTOCOL41)
69-
writeln("\tCan use 4.1+ protocol");
70-
if(caps && SvrCapFlags.INTERACTIVE)
71-
writeln("\tInteractive client?");
72-
if(caps && SvrCapFlags.SSL)
73-
writeln("\tCan switch to SSL after handshake");
74-
if(caps && SvrCapFlags.IGNORE_SIGPIPE)
75-
writeln("\tIgnore sigpipes?");
76-
if(caps && SvrCapFlags.TRANSACTIONS)
77-
writeln("\tTransaction Support");
78-
if(caps && SvrCapFlags.SECURE_CONNECTION)
79-
writeln("\t4.1+ authentication");
80-
if(caps && SvrCapFlags.MULTI_STATEMENTS)
81-
writeln("\tMultiple statement support");
82-
if(caps && SvrCapFlags.MULTI_RESULTS)
83-
writeln("\tMultiple result set support");
84-
writeln();
85-
86-
MetaData md = MetaData(c);
87-
auto dbList = md.databases();
88-
writefln("Found %s databases", dbList.length);
89-
foreach( db; dbList )
90-
{
91-
c.selectDB(db);
92-
auto curTables = md.tables();
93-
writefln("Database '%s' has %s table%s.", db, curTables.length, curTables.length == 1?"":"s");
94-
foreach(tbls ; curTables)
95-
{
96-
writefln("\t%s", tbls);
97-
}
98-
}
48+
auto caps = c.serverCapabilities;
49+
writefln("MySQL Server %s with capabilities (%b):", c.serverVersion, caps);
50+
if(caps && SvrCapFlags.OLD_LONG_PASSWORD)
51+
writeln("\tLong passwords");
52+
if(caps && SvrCapFlags.FOUND_NOT_AFFECTED)
53+
writeln("\tReport rows found rather than rows affected");
54+
if(caps && SvrCapFlags.ALL_COLUMN_FLAGS)
55+
writeln("\tSend all column flags");
56+
if(caps && SvrCapFlags.WITH_DB)
57+
writeln("\tCan take database as part of login");
58+
if(caps && SvrCapFlags.NO_SCHEMA)
59+
writeln("\tCan disallow database name as part of column name database.table.column");
60+
if(caps && SvrCapFlags.CAN_COMPRESS)
61+
writeln("\tCan compress packets");
62+
if(caps && SvrCapFlags.ODBC)
63+
writeln("\tCan handle ODBC");
64+
if(caps && SvrCapFlags.LOCAL_FILES)
65+
writeln("\tCan use LOAD DATA LOCAL");
66+
if(caps && SvrCapFlags.IGNORE_SPACE)
67+
writeln("\tCan ignore spaces before '('");
68+
if(caps && SvrCapFlags.PROTOCOL41)
69+
writeln("\tCan use 4.1+ protocol");
70+
if(caps && SvrCapFlags.INTERACTIVE)
71+
writeln("\tInteractive client?");
72+
if(caps && SvrCapFlags.SSL)
73+
writeln("\tCan switch to SSL after handshake");
74+
if(caps && SvrCapFlags.IGNORE_SIGPIPE)
75+
writeln("\tIgnore sigpipes?");
76+
if(caps && SvrCapFlags.TRANSACTIONS)
77+
writeln("\tTransaction Support");
78+
if(caps && SvrCapFlags.SECURE_CONNECTION)
79+
writeln("\t4.1+ authentication");
80+
if(caps && SvrCapFlags.MULTI_STATEMENTS)
81+
writeln("\tMultiple statement support");
82+
if(caps && SvrCapFlags.MULTI_RESULTS)
83+
writeln("\tMultiple result set support");
84+
writeln();
85+
86+
MetaData md = MetaData(c);
87+
auto dbList = md.databases();
88+
writefln("Found %s databases", dbList.length);
89+
foreach( db; dbList )
90+
{
91+
c.selectDB(db);
92+
auto curTables = md.tables();
93+
writefln("Database '%s' has %s table%s.", db, curTables.length, curTables.length == 1?"":"s");
94+
foreach(tbls ; curTables)
95+
{
96+
writefln("\t%s", tbls);
97+
}
98+
}
9999
}

0 commit comments

Comments
 (0)