Re: question on dub and postgresql

2020-10-08 Thread Alaindevos via Digitalmars-d-learn
I found dub.json has very important info, To name three : importPaths , libs , dependencies. When these are right you have started for 80%. Without nagging, when you begin you are however lost in the woods and it makes the impression to lose interest completely. For ease there is : targetName,

Re: question on dub and postgresql

2020-10-08 Thread ddcovery via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 19:15:42 UTC, aberba wrote: It seems the D ecosystem is not immediately obvious to some people. Dub, compilers, and IDEs are recurring issues. and debbuging (particularly inspection)

Re: question on dub and postgresql

2020-10-07 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Oct 07, 2020 at 07:15:42PM +, aberba via Digitalmars-d-learn wrote: [...] > It seems the D ecosystem is not immediately obvious to some people. > Dub, compilers, and IDEs are recurring issues. This is stuff that needs to be documented up-front and in-your-face. For example, if we're

Re: question on dub and postgresql

2020-10-07 Thread aberba via Digitalmars-d-learn
On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote: On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: [...] Yes and no. Dub is Dlang dependency solution but

Re: question on dub and postgresql

2020-10-05 Thread James Blachly via Digitalmars-d-learn
On 10/5/20 11:42 AM, Alaindevos wrote: Use "rangify" template to get forward range from answer Thanks, this answers the question on programmatic level. Yet I guess something is special with the answer datatype which makes foreach to fail. Instead of thinking of it as "foreach failing,"

Re: question on dub and postgresql

2020-10-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/5/20 6:01 AM, Alaindevos wrote: On Monday, 5 October 2020 at 09:24:33 UTC, Mike Parker wrote: On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote: [...] You don't need to install dpq2 if you are using dub to build your project. Add it as a dependency to your dub.json (or

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 13:30:22 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 11:35:43 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: [...] No, you just dub add dpq2 With dub.json: "dependencies": { "dpq2": "~>1.0.17"

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
Use "rangify" template to get forward range from answer Thanks, this answers the question on programmatic level. Yet I guess something is special with the answer datatype which makes foreach to fail.

Re: question on dub and postgresql

2020-10-05 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 5 October 2020 at 15:08:54 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 14:57:53 UTC, Alaindevos wrote: answer[0][0].as!PGtext contains good data I found an answer. foreach(rownumber; answer.length.iota){ auto arow=answer[rownumber]; writeln(arow); } Yet it would be nice

Re: question on dub and postgresql

2020-10-05 Thread Mike Parker via Digitalmars-d-learn
On Monday, 5 October 2020 at 15:08:54 UTC, Alaindevos wrote: Yet it would be nice to know why i can't iterate directly over answer using foreach. Looking at the implementation of the `Answer` type [1], I see no way to create a range or a slice, and no `opApply`. So you'll have to ask the

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 14:57:53 UTC, Alaindevos wrote: answer[0][0].as!PGtext contains good data I found an answer. foreach(rownumber; answer.length.iota){ auto arow=answer[rownumber]; writeln(arow); } Yet it would be nice to know why i can't iterate directly over answer using

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
answer[0][0].as!PGtext contains good data

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
Just Connection worked. But how do I loop over results of a select statement. string sql=format(" SELECT * from %s ;",tablepredata); auto answer = conn.exec(sql); foreach(arow; answer){ writeln(arow); } Fails with, dub ~master: building configuration "application"... source/app.d(36,3):

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 13:30:22 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 11:35:43 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC,

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 11:35:43 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at:

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at: https://code.dlang.org/packages/dpq2 https://code.dlang.org/packages/ddbc Say I want

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 09:24:33 UTC, Mike Parker wrote: On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote: [...] You don't need to install dpq2 if you are using dub to build your project. Add it as a dependency to your dub.json (or dub.sdl if you prefer that format). When

Re: question on dub and postgresql

2020-10-05 Thread Mike Parker via Digitalmars-d-learn
On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote: A name dependency solution is at least vage. How do I install , https://github.com/denizzzka/dpq2 on unix so in the code i write the .d files of that library and after compilation linked to the libary shared objects. For that shared

Re: question on dub and postgresql

2020-10-05 Thread drug via Digitalmars-d-learn
On 10/5/20 12:05 PM, Alaindevos wrote: On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote: On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: Can I say python has pip, ruby has bundle and D has dub. Meaning they perform

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote: On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: Can I say python has pip, ruby has bundle and D has dub. Meaning they perform the same function ? Or am I wrong? Yes

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:50:53 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at:

Re: question on dub and postgresql

2020-10-05 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > Can I say python has pip, ruby has bundle and D has dub. > Meaning they perform the same function ? > Or am I wrong? > Yes and no. Dub is Dlang dependency solution but it is not

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at: https://code.dlang.org/packages/dpq2 https://code.dlang.org/packages/ddbc Say I want

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:34:37 UTC, Imperatorn wrote: On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: [...] Take a look at: https://code.dlang.org/packages/dpq2 https://code.dlang.org/packages/ddbc Say I want to use dpq2. Do I need to clone the git repository with "git

Re: question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: Can I say python has pip, ruby has bundle and D has dub. Meaning they perform the same function ? Or am I wrong? As I use unix the parameters for include and library are a real pain. I have totally no idea how to connect to a

Re: question on dub and postgresql

2020-10-05 Thread Imperatorn via Digitalmars-d-learn
On Monday, 5 October 2020 at 08:24:26 UTC, Alaindevos wrote: Can I say python has pip, ruby has bundle and D has dub. Meaning they perform the same function ? Or am I wrong? As I use unix the parameters for include and library are a real pain. I have totally no idea how to connect to a