Re: Can your programming language do this?

2011-01-25 Thread Jacob Carlborg
On 2011-01-25 17:41, Piotr Szturmaj wrote: Andrew Wiley wrote: I know I keep beating this horse, but in other languages, this is the textbook example for why annotations are useful. Adding metadata to code, even if it can only be examined at compile time, can be immensely useful. I fully agree

Re: Can your programming language do this?

2011-01-25 Thread Adam Ruppe
> Please read my messages in "D2 postgresql interface - Phobos2?" thread (D.learn). Wow, that looks outstanding! I look forward to the release.

Re: Can your programming language do this?

2011-01-25 Thread Adam Ruppe
> I know I keep beating this horse, but in other languages, this is the > textbook example for why annotations are useful. Adding metadata to > code, even if it can only be examined at compile time, can be > immensely useful. I agree, I think the @attrs should have been shorthand for user defined

Re: Can your programming language do this?

2011-01-25 Thread Piotr Szturmaj
Andrew Wiley wrote: I know I keep beating this horse, but in other languages, this is the textbook example for why annotations are useful. Adding metadata to code, even if it can only be examined at compile time, can be immensely useful. I fully agree. However, I did create some substitute: st

Re: Can your programming language do this?

2011-01-25 Thread Piotr Szturmaj
Adam Ruppe wrote: string name; int id; db_statement.execute(); while(db_statement.next(id, name)) { // the variables id and name are now filled in with the row } That's nice too! But, a real database has a lot of constraints on top of that - field lengths, foreign keys, checks, and s

Re: Can your programming language do this?

2011-01-25 Thread Andrew Wiley
On Tue, Jan 25, 2011 at 9:48 AM, Adam Ruppe wrote: > Piotr Szturmaj wrote: > > I already have working postgresql row querying. There are typed and > > untyped rows. Untyped row is DBRow!(Variant[]), typed rows are > > encapsulated using struct or tuple, for example: > > Very nice! I did something

Re: Can your programming language do this?

2011-01-25 Thread Adam Ruppe
Piotr Szturmaj wrote: > I already have working postgresql row querying. There are typed and > untyped rows. Untyped row is DBRow!(Variant[]), typed rows are > encapsulated using struct or tuple, for example: Very nice! I did something similar in two cases: one is the byStruct in mysql.d (currently

Re: Can your programming language do this?

2011-01-24 Thread Piotr Szturmaj
Hi, I'm also working on postgresql client implementation and common DB interface (in my spare time between other projects). It's using native postgres protocol without using libpq. Tt also supports binary formatting of row fields - that should outperform textual libraries (no parsing/toString).

Re: Can your programming language do this?

2011-01-24 Thread Adam Ruppe
Nick wrote: > You should stick this in the announcements group. Yeah, I'm still working some kinks out though. (Trial by fire - I ended up pushing the *new* mysql module to the live work server in an unrelated update yesterday! So now frantically fixing things for tonight's launches... The breaka

Re: Can your programming language do this?

2011-01-24 Thread Nick Sabalausky
t a list of CREATE TABLE commands. I ran the program over > a far more complex file too and it worked, but it isn't a super > smart parser so you can probably break it pretty easily. (for one, > it is case sensitive where as standard SQL is not) You should stick this in the announcements group. This sounds like a fantasically useful tool, but with only a post in this "misc bin" NG named "Can your programming language do this?" it's likely to just get lost.

Re: Can your programming language do this?

2011-01-23 Thread Adam D. Ruppe
Simen kjaeraas wrote: > I've known that D could do it, and I've occasionally > poked at it myself, but always felt it was too much work for > something that isn't all that hard to do by hand. Yeah, that's the way I feel about it mostly. What finally pushed me over the edge here was writing yet /an

Re: Can your programming language do this?

2011-01-23 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ihhsv0$1fgf$1...@digitalmars.com... > alias DataObjectFromSqlCreateTable!(import("db.sql"), "users") User; > // sql source code , table to fetch > > void main() { >auto obj = new User(null); // that null should actually be

Re: Can your programming language do this?

2011-01-23 Thread Simen kjaeraas
Adam D. Ruppe wrote: alias DataObjectFromSqlCreateTable!(import("db.sql"), "users") User; // sql source code , table to fetch void main() { auto obj = new User(null); // that null should actually be a db handle if you want to be able to commit changes

Can your programming language do this?

2011-01-23 Thread Adam D. Ruppe
alias DataObjectFromSqlCreateTable!(import("db.sql"), "users") User; // sql source code , table to fetch void main() { auto obj = new User(null); // that null should actually be a db handle if you want to be able to commit changes // read/write access to t