View previous topic :: View next topic |
Author |
Message |
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Fri Jun 30, 2006 12:13 pm Post subject: imp.d questions |
|
|
I have a bunch of files that constitute my bindings to FreeTDS for MSSQL/Sybase.
Code: | > ll *.d
-rw-r--r-- 1 brad users 2 Jun 1 23:34 bkpublic.d
-rw-r--r-- 1 brad users 17 Jun 1 23:34 cspublic.d
-rw-r--r-- 1 brad users 3 Jun 1 23:34 cstypes.d
-rw-r--r-- 1 brad users 4 Jun 3 15:09 ctpublic.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 sqldb.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 sqlfront.d
-rw-r--r-- 1 brad users 32 Jun 1 23:34 sybdb.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 syberror.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 sybfront.d
-rw-r--r-- 1 brad users 28 Jun 3 12:52 tds.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 tds_sysdep_public.d
-rw-r--r-- 1 brad users 2 Jun 1 23:34 tdsconvert.d
-rw-r--r-- 1 brad users 2 Jun 1 23:34 tdssrv.d
-rw-r--r-- 1 brad users 1 Jun 1 23:34 tdsver.d
|
Should I put them all in one imp.d file, or have imp.d import them from a sub-folder?
Or, should I move only the necessary wrappers into a new imp.d file? For instance, I'm using the ctlib, so I wouldn't need much of the sqldb,sqlfront stuffs.
BA |
|
Back to top |
|
|
jpelcis
Joined: 09 Mar 2006 Posts: 40
|
Posted: Fri Jun 30, 2006 3:28 pm Post subject: Re: imp.d questions |
|
|
brad wrote: |
I have a bunch of files that constitute my bindings to FreeTDS for MSSQL/Sybase.
Should I put them all in one imp.d file, or have imp.d import them from a sub-folder?
Or, should I move only the necessary wrappers into a new imp.d file? For instance, I'm using the ctlib, so I wouldn't need much of the sqldb,sqlfront stuffs.
|
If I remember the size of FreeTDS correctly, it would be somewhat excessive for a single file. If it's reasonable after the conversion to D (50 to 75 kB or so), go ahead and put it in an imp.d. Otherwise, just put it all in a subdirectory called imp and it can be imported from there.
That said, can I assume from this (especially a .d version of all the important files) that you are either completely or nearly done? If it's ready, I can include it in the next version of D DBI under the new BSD license. Regardless, thank you! |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Fri Jun 30, 2006 3:38 pm Post subject: Re: imp.d questions |
|
|
jpelcis wrote: | brad wrote: |
I have a bunch of files that constitute my bindings to FreeTDS for MSSQL/Sybase.
Should I put them all in one imp.d file, or have imp.d import them from a sub-folder?
Or, should I move only the necessary wrappers into a new imp.d file? For instance, I'm using the ctlib, so I wouldn't need much of the sqldb,sqlfront stuffs.
|
If I remember the size of FreeTDS correctly, it would be somewhat excessive for a single file. If it's reasonable after the conversion to D (50 to 75 kB or so), go ahead and put it in an imp.d. Otherwise, just put it all in a subdirectory called imp and it can be imported from there.
That said, can I assume from this (especially a .d version of all the important files) that you are either completely or nearly done? If it's ready, I can include it in the next version of D DBI under the new BSD license. Regardless, thank you! |
Well, the dir listing might be impressive, but it was GregorR's bcd that did the bindings automatically. I'm still trying to go through getting each fieldtype and the values from them. Then I will integrate with ddbi, so I still have a ways to go.
Done:
int
float
varchar,nvarchar
money,smallmoney
ToDo:
datetime, smalldatetime (in process)
decimal,numeric (may already work, need to test)
text
Low Priority:
all other types, like binary, varbinary, timestamp, table, blah blah blah
I also have questions about everything currently being returned as a string. Do you think we should have getInt(), getString() and getDate() methods - the getDate() is the one of current interest and we could return a std.date (phobos) object.
BA |
|
Back to top |
|
|
jpelcis
Joined: 09 Mar 2006 Posts: 40
|
Posted: Fri Jun 30, 2006 4:19 pm Post subject: Re: imp.d questions |
|
|
brad wrote: |
Well, the dir listing might be impressive, but it was GregorR's bcd that did the bindings automatically. I'm still trying to go through getting each fieldtype and the values from them. Then I will integrate with ddbi, so I still have a ways to go.
|
Ok, I'll release a bit without that. Just out of curiosity, roughly how long do you think it will take?
brad wrote: |
I also have questions about everything currently being returned as a string. Do you think we should have getInt(), getString() and getDate() methods - the getDate() is the one of current interest and we could return a std.date (phobos) object.
|
My personal feeling is that all of the C functions should be left untouched, but a wrapper (aside from D DBI) can be written over them. That part is mostly a factor of how energetic you feel. Making it as easy as possible to use with D is great though. |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Fri Jun 30, 2006 5:22 pm Post subject: Re: imp.d questions |
|
|
jpelcis wrote: | brad wrote: |
Well, the dir listing might be impressive, but it was GregorR's bcd that did the bindings automatically. I'm still trying to go through getting each fieldtype and the values from them. Then I will integrate with ddbi, so I still have a ways to go.
|
Ok, I'll release a bit without that. Just out of curiosity, roughly how long do you think it will take? |
ha! no clue. Lots of stuff competing...
jpelcis wrote: | brad wrote: |
I also have questions about everything currently being returned as a string. Do you think we should have getInt(), getString() and getDate() methods - the getDate() is the one of current interest and we could return a std.date (phobos) object.
|
My personal feeling is that all of the C functions should be left untouched, but a wrapper (aside from D DBI) can be written over them. That part is mostly a factor of how energetic you feel. Making it as easy as possible to use with D is great though. |
I was talking only of D code in ddbi's Row object. All the C functions are untouched, as you say. But if someone wanted to get at the hour portion of a date field value, they could do
Code: |
Date date = row.getDate("startdate");
int hour = date.getHour();
|
|
|
Back to top |
|
|
jpelcis
Joined: 09 Mar 2006 Posts: 40
|
Posted: Fri Jun 30, 2006 6:33 pm Post subject: Re: imp.d questions |
|
|
brad wrote: |
ha! no clue. Lots of stuff competing...
|
I know that feeling.
brad wrote: |
Code: |
Date date = row.getDate("startdate");
int hour = date.getHour();
|
|
oooo... I like it. Maybe the whole Row class should be overhauled. I'll look into it overnight and report back tomorrow. Recommendations would be welcome, too. |
|
Back to top |
|
|
jpelcis
Joined: 09 Mar 2006 Posts: 40
|
Posted: Sat Jul 01, 2006 3:16 pm Post subject: The conversion has been relocated. |
|
|
Since this no longer has anything to do with imp.d questions (and to make this more visible), I have created a new topic specifically to discuss what to do to dbi.Row at http://www.dsource.org/forums/viewtopic.php?p=9947. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|