DUB mysql-native

Vino akashvino79 at gmail.com
Tue Oct 8 14:02:03 UTC 2019


On Tuesday, 8 October 2019 at 11:26:24 UTC, Daniel Kozak wrote:
> On Tue, Oct 8, 2019 at 1:15 PM Daniel Kozak <kozzi11 at gmail.com> 
> wrote:
>> ...
>> It is known issue, you can not use mysql-native right now with
>> anything else than libevent
>>
>> https://github.com/mysql-d/mysql-native/issues/199
>>
>> Or you can just remove
>>
>> "subConfigurations": {
>> "vibe-d:core": "libevent"
>> },
>>
>> from ~/.dub/packages/mysql-native-2.3.0/mysql-native/dub.json
>
> https://github.com/mysql-d/mysql-native/commit/ec851956e579bab8d00b1ae89a5344a2babce2e3

Hi Daniel,

    As stated I have removed those line and ran the below command

dub build --force - No issue
dub test - failed with the below error

dub build --force
Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for 
x86_64.
dub 1.17.0: building configuration "library"...
Serializing composite type BuildRequirements which has no 
serializable fields
Serializing composite type BuildOptions which has no serializable 
fields
taggedalgebraic 0.11.4: building configuration "library"...
eventcore 0.8.46: building configuration "winapi"...
stdx-allocator 2.77.5: building configuration "library"...
vibe-core 1.7.0: building configuration "winapi"...
vibe-d:utils 0.8.6: building configuration "library"...
vibe-d:data 0.8.6: building configuration "library"...
mysql-native 2.3.0: building configuration "library"...
..\..\..\AppData\Local\dub\packages\mysql-native-2.3.0\mysql-native\source\mysql\connection.d(1192,27): Deprecation: function std.typecons.Nullable!(PreparedServerInfo).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
..\..\..\AppData\Local\dub\packages\mysql-native-2.3.0\mysql-native\source\mysql\pool.d(115,13): Deprecation: constructor vibe.core.connectionpool.ConnectionPool!(Connection).ConnectionPool.this is deprecated - Use an @safe callback instead
..\..\..\AppData\Local\dub\packages\mysql-native-2.3.0\mysql-native\source\mysql\pool.d(361,27): Deprecation: function std.typecons.Nullable!(PreparedInfo).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
..\..\..\AppData\Local\dub\packages\mysql-native-2.3.0\mysql-native\source\mysql\pool.d(378,26): Deprecation: function std.typecons.Nullable!(PreparedInfo).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
..\..\..\AppData\Local\dub\packages\mysql-native-2.3.0\mysql-native\source\mysql\protocol\comms.d(418,3): Deprecation: foreach: loop index implicitly converted from size_t to ushort
hub ~master: building configuration "application"...
Linking...
Copying files for dub...

dub test
No source files found in configuration 'library'. Falling back to 
"dub -b unittest".
Performing "unittest" build using C:\D\dmd2\windows\bin\dmd.exe 
for x86_64.
dub 1.17.0: target for configuration "library" is up to date.
taggedalgebraic 0.11.4: target for configuration "library" is up 
to date.
eventcore 0.8.46: target for configuration "winapi" is up to date.
stdx-allocator 2.77.5: target for configuration "library" is up 
to date.
vibe-core 1.7.0: target for configuration "winapi" is up to date.
vibe-d:utils 0.8.6: target for configuration "library" is up to 
date.
vibe-d:data 0.8.6: target for configuration "library" is up to 
date.
mysql-native 2.3.0: target for configuration "library" is up to 
date.
hub ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dub...
Running .\hub.exe
Program exited with code -1073741515

Error:
The code execution cannot proceed because msvcr100.dll was not 
found. Reinstalling the program  may fix this problem.

Execution HUB/source/app.d
import std.array : array;
import std.variant;
import mysql;
import std.stdio;

void main(string[] args)
{
	auto connectionStr = 
"host=dev.server1.com;port=3910;user=testuser;pwd=XXXX#;db=test";
	if(args.length > 1)
		connectionStr = args[1];
	Connection conn = new Connection(connectionStr);
	scope(exit) conn.close();

	ResultRange range = conn.query("SELECT host_name FROM 
`devservers`");
	Row row = range.front;
	Variant host_name = row[0];
	writeln(host_name);
}

Code Execution
cd HUB/source
rdmd app.d

app.d(3): Error: module `mysql` is in file 'mysql.d' which cannot 
be read
import path[0] = .
import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
Failed: ["C:\\D\\dmd2\\windows\\bin\\dmd.exe", "-v", "-o-", 
"app.d", "-I."]

From,
Vino.B



More information about the Digitalmars-d-learn mailing list