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 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: Learn D while updating Rosetta code

2020-10-05 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 4 October 2020 at 19:45:29 UTC, Imperatorn wrote: Just a tip to everyone. If you're trying to learn D, you can try to implement some of these missing tasks and update the corresponding page: http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_D In addition you can solve

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 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 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 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 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

question on dub and postgresql

2020-10-05 Thread Alaindevos via Digitalmars-d-learn
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 postgresql database. Where and how do I start to connect to a

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

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 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: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 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 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 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: Edit

2020-10-05 Thread ryuukk_ via Digitalmars-d-learn
On Monday, 5 October 2020 at 11:14:47 UTC, frame wrote: So I found out that there is nothing wrong with the method as in a test environment the allocated memory block is removed after GC.minimize(). Still need to find out why other blocks are not released. However, is there a way to debug

Edit

2020-10-05 Thread frame via Digitalmars-d-learn
So I found out that there is nothing wrong with the method as in a test environment the allocated memory block is removed after GC.minimize(). Still need to find out why other blocks are not released. However, is there a way to debug currently allocated variables by the GC?

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 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 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 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 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 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"