Skip to content

Commit 776547e

Browse files
committed
async/nb (WIP), freetds LOGINREC stuff, etc
.gitignore, subpackages (WIP) package.json->dub.json, Impl refactor mysql backend improvements, resolve in front end, freetds direct host/port
1 parent bc5627d commit 776547e

40 files changed

Lines changed: 2038 additions & 1519 deletions

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.[oa]
2+
*.so
3+
*.lib
4+
*.dll
5+
6+
.dub
7+
dub.selections.json
8+
9+
.DS_Store
10+
11+
#unit test binaries
12+
tests/*/tests
13+
__test__*__
14+

README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Available in [DUB](https://code.dlang.org/packages/dstddb), the D package regist
1313
- A range interface for query result sets
1414
- Support a for [fluent](http://en.wikipedia.org/wiki/Fluent_interface) style interface
1515
- URL style connection strings
16-
- Reference implementations so far: mysql, sqlite, oracle, and ODBC
16+
- Reference implementations so far: ODBC, sqlite, mysql, oracle, postgres, freetds (MS SQL)
1717
- Support for allocators
1818
- Support for runtime driver registration
1919
- Input variable binding support
@@ -97,14 +97,3 @@ createDatabase("file:///demo.sqlite")
9797
9898
- The reference implementations use logging (std.experimental.logger). To hide the info logging, add this line to your package.json file: "versions": ["StdLoggerDisableInfo"].
9999
100-
## Status
101-
102-
WIP
103-
104-
| Feature | sqlite | mysql | oracle | postgres | odbc | poly |
105-
| :--------------------------- | :----- | :----- | :----- | :------ | :---- | :---- |
106-
| command only execution | y | y | y | y | y | |
107-
| select no-bind with results | y | y | y | y | y | |
108-
| input binding (string/int only) | y | y | y | y | | |
109-
| native column type buffers | | y | | | | |
110-

dub.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44
"copyright": "Copyright © 2015, Erik Smith",
55
"authors": ["Erik Smith"],
66
"license": "MIT",
7-
"dependencies": {}
7+
"dependencies": {
8+
"dstddb:mysql": "*",
9+
"dstddb:odbc": "*",
10+
"dstddb:oracle": "*",
11+
"dstddb:postgres": "*",
12+
"dstddb:reference": "*",
13+
"dstddb:sqlite": "*",
14+
"dstddb:util": "*",
15+
"dstddb:vibe": "*",
16+
"dstddb:webscalesql": "*",
17+
},
18+
"subPackages": [
19+
"./mysql/",
20+
"./odbc/",
21+
"./oracle/",
22+
"./postgres/",
23+
"./reference/",
24+
"./sqlite/",
25+
"./util/",
26+
"./vibe/",
27+
"./webscalesql/"
28+
],
829
}
930

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "std_database_freetds",
2+
"name": "freetds",
33
"description": "Phobos std.database candidate",
44
"homepage": "",
55
"copyright": "Copyright © 2015-, Erik Smith",
66
"authors": [
77
"Erik Smith"
88
],
9-
"sourcePaths": [".", "../../src"],
9+
"sourcePaths": [".", "../src"],
1010
"libs" : ["sybdb"],
1111
"dependencies": {
1212
},
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ unittest {
1111
alias DB = Database!DefaultPolicy;
1212
testAll!DB("freetds");
1313

14-
//simpleTest();
14+
//example();
1515
//backTest();
1616
}
17-
void simpleTest() {
18-
auto db = createDatabase("freetds://server/test?username=sa&password=admin");
19-
string sql = "12 SELEC 1,2,3"; // error check
20-
//string sql = "SELECT * FROM master.dbo.spt_monitor";
21-
writeResult(db.query(sql));
17+
18+
void example() {
19+
import std.database.freetds;
20+
//auto db = createDatabase("freetds://server/test?username=sa&password=admin");
21+
auto db = createDatabase("freetds://10.211.55.3:1433/test?username=sa&password=admin");
22+
auto result = db.query("SELECT 1,2,'abc'");
23+
foreach (r; result) {
24+
for(int c = 0; c != r.columns; ++c) writeln("column: ",c,", value: ",r[c].as!string);
25+
}
2226
}
2327

28+
/*
2429
void backTest() {
2530
//string sql = "SELECT * FROM dbo.spt_monitor";
2631
string sql = "SELECT 1,2,3";
@@ -36,5 +41,6 @@ void backTest() {
3641
writeln("second: ", result.get!string(&result.bind[1]));
3742
} while (result.next());
3843
}
44+
*/
3945

4046

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
{
2-
"name": "std_database_mysql",
2+
"name": "mysql",
33
"description": "Phobos std.database candidate",
44
"homepage": "",
55
"copyright": "Copyright © 2015-, Erik Smith",
66
"authors": [
77
"Erik Smith"
88
],
9-
"sourcePaths": [".", "../../src"],
9+
"sourcePaths": [".", "../src"],
1010
"libs" : ["mysqlclient"],
11-
"dependencies": {
12-
},
1311
"configurations": [
14-
{
15-
"name": "library",
16-
"targetType": "executable",
17-
},
1812
{
1913
"name": "unittest",
2014
"targetType": "executable",

test/mysql/test.d renamed to mysql/test.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ void perf1() {
6060
writeln("time: ", to!Duration(sw2.peek));
6161
}
6262

63-
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "std_database_odbc",
2+
"name": "odbc",
33
"description": "Phobos std.database candidate",
44
"homepage": "",
55
"copyright": "Copyright © 2015-, Erik Smith",
66
"authors": [
77
"Erik Smith"
88
],
9-
"sourcePaths": [".", "../../src"],
9+
"sourcePaths": [".", "../src"],
1010
"libs" : ["odbc","sqlite3"],
1111
"dependencies": {
1212
},
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "std_database_oracle",
2+
"name": "oracle",
33
"description": "Phobos std.database candidate",
44
"homepage": "",
55
"copyright": "Copyright © 2015-, Erik Smith",
66
"authors": [
77
"Erik Smith"
88
],
9-
"sourcePaths": [".", "../../src"],
9+
"sourcePaths": [".", "../src"],
1010
"libs" : ["occi","clntsh"],
1111
"dependencies": {
1212
},

0 commit comments

Comments
 (0)