Thread overview
Assistance with DUB
Nov 01, 2016
Alfred Newman
Nov 02, 2016
Basile B.
Nov 17, 2016
Stefan Koch
November 01, 2016
Greetings,

I need some help with dub libraries.

Executing "dub list" in my machine, I got the following:

Packages present in the system and known to dub:
colorize ~master: C:\Users\Alfred\AppData\Roaming\dub\packages\colorize-master\colorize\
...
sqlite-d ~master: C:\Users\Alfred\AppData\Roaming\dub\packages\sqlite-d-master\sqlite-d\
x11 1.0.15: C:\Users\Alfred\AppData\Roaming\dub\packages\x11-1.0.15\x11\

*** Note that sqlite-d is listed there.

When I try to run the code in the end of this thread, I got the following error:

compiling C:...\Projects\temp2.d
C:\Users\Alfred\Dropbox\Dlang\Projects\temp2.d(8,8): Error: module sqlited is in file 'sqlited.d' which cannot be read (***)
import path[0] = C:\D\dmd2\src\phobos
import path[1] = C:\D\dmd2\src\druntime\import
import path[2] = C:\Users\Alfred\AppData\Roaming\dub\packages\colorize-master\colorize\source
import path[3] = C:\Users\Alfred\AppData\Roaming\dub\packages\sqlite-d-master\sqlite-d
import path[4] = C:\Users\Alfred\AppData\Roaming\dub\packages\d2sqlite3-master\d2sqlite3\source
import path[5] = C:\D\dmd2\windows\bin....\src\phobos
import path[6] = C:\D\dmd2\windows\bin....\src\druntime\import
error: the process (dmd) has returned the signal 1
C:...\Projects\temp2.d has not been compiled

I'm stucked. Please, can you help me out ?

Cheers, AN


module test;

//          Copyright Stefan Koch 2015 - 2018.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE.md or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

import sqlited;
import misc;
import sqlstuff;

static immutable long_create_table =
q{CREATE TABLE `hey`	INTEGER,
	`Field2`	INTEGER
)};
static immutable test_s3db = cast(immutable)Database(cast(immutable ubyte[]) import("test.s3db"));
static immutable Database.MasterTableSchema[] schemas = readRows!(r => r.deserialize!(Database.MasterTableSchema))(test_s3db.rootPage, test_s3db.pages);
static assert(schemas[2].sql==long_create_table);

import frail_sql_parser;

static assert (parseCreateTable(
	q{CREATE TABLE spatial_ref_sys (
		srid INTEGER NOT NULL PRIMARY KEY,
		auth_name VARCHAR(256) NOT NULL,
		auth_srid INTEGER NOT NULL,
		ref_sys_name VARCHAR(256),
		proj4text VARCHAR(2048) NOT NULL)}
	) == TableInfo("spatial_ref_sys", [
			ColumInfo("srid", "INTEGER", true, true),
			ColumInfo("auth_name", "VARCHAR(256)", false, true),
			ColumInfo("auth_srid", "INTEGER", false, true),
			ColumInfo("ref_sys_name","VARCHAR(256)",false),
			ColumInfo("proj4text","VARCHAR(2048)", false, true),
	])
);
static assert(parseCreateTable(long_create_table) == TableInfo("hey", "INTEGER"), ColumInfo("Field2", "INTEGER")]));

static assert(parseCreateTable(
q{CREATE TABLE Towns (
				PK_UID INTEGER PRIMARY KEY AUTOINCREMENT,
				Name TEXT,
				Peoples INTEGER,
				LocalCounc INTEGER,
				County INTEGER,
				Region INTEGER, "Geometry" POINT)
}
	) == TableInfo("Towns", [
		ColumInfo("PK_UID", "INTEGER", true, false, false, true),
		ColumInfo("Name", "TEXT"),
		ColumInfo("Peoples", "INTEGER"),
		ColumInfo("LocalCounc", "INTEGER"),
		ColumInfo("County", "INTEGER"),
		ColumInfo("Region", "INTEGER"),
		ColumInfo("Geometry", "POINT")
	])
);
November 02, 2016
On Tuesday, 1 November 2016 at 22:01:23 UTC, Alfred Newman wrote:
> Greetings,
>
> I need some help with dub libraries.
>
> Executing "dub list" in my machine, I got the following:
>
> Packages present in the system and known to dub:
> colorize ~master: C:\Users\Alfred\AppData\Roaming\dub\packages\colorize-master\colorize\
> ...
> sqlite-d ~master: C:\Users\Alfred\AppData\Roaming\dub\packages\sqlite-d-master\sqlite-d\
> x11 1.0.15: C:\Users\Alfred\AppData\Roaming\dub\packages\x11-1.0.15\x11\
>
> *** Note that sqlite-d is listed there.
>
> When I try to run the code in the end of this thread, I got the following error:
>
> compiling C:...\Projects\temp2.d
> C:\Users\Alfred\Dropbox\Dlang\Projects\temp2.d(8,8): Error: module sqlited is in file 'sqlited.d' which cannot be read (***)
> import path[0] = C:\D\dmd2\src\phobos
> import path[1] = C:\D\dmd2\src\druntime\import
> import path[2] = C:\Users\Alfred\AppData\Roaming\dub\packages\colorize-master\colorize\source
> import path[3] = C:\Users\Alfred\AppData\Roaming\dub\packages\sqlite-d-master\sqlite-d
> import path[4] = C:\Users\Alfred\AppData\Roaming\dub\packages\d2sqlite3-master\d2sqlite3\source
> import path[5] = C:\D\dmd2\windows\bin....\src\phobos
> import path[6] = C:\D\dmd2\windows\bin....\src\druntime\import
> error: the process (dmd) has returned the signal 1
> C:...\Projects\temp2.d has not been compiled
>
> I'm stucked. Please, can you help me out ?

To compile a DUB script (It looks like you tried to do that) add this:

/+ dub.sdl:
   name "dub_script"
   dependency "sqlite-d" version="~>0.1.0"
+/

before the module declaration. It acts as a description.
November 17, 2016
On Tuesday, 1 November 2016 at 22:01:23 UTC, Alfred Newman wrote:
> Greetings,
>
> I need some help with dub libraries.
>
> [...]

test.d assumes that sqlite.d is given on the same compile command-line.
This is the case when sqlite-d is build as a stand-alone app.
If you want to integrate it I advise deleting the app.d and test.d.

Please feel free to ask me anything about sqlite-d.