Hmm, I'm debating this now. I thought that SQLite supported a boolean type
because SQLite Administrator had that as an option when defining tables.
Turns out that booleans don't really exist in SQLite, ref if anyone needs
it: http://www.sqlite.org/datatype3.html. So what to do? Should it translate
booleans as (MyCol='Y' or MyCol=1 or  MyCol='y') and the inverse?  I guess
that'd work. Sqlite administrator is turning a boolean checkbox from its
interface into Y/N.

I think this didn't come up yet because there's no boolean fields in
northwind that I can see. Probably because of the fact that many databases
don't support them. Still, dblinq ought to have some way to translate from
the boolean object type in .net to a something in the target db.

Might be related, might not, but dbmetal did interpret the 'Boolean' type in
the database as a boolean in .net. The create script from SQLite admin looks
like this:

CREATE TABLE [Users] (
[Id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
[UserName] varchar(20)  UNIQUE NOT NULL,
[Password] varchAR(20)  NULL,
[FirstName] vaRCHAR(20)  NULL,
[LastName] varchar(20)  NULL,
[Active] BOOLEAN DEFAULT 'Y' NOT NULL
)

It seems likely that SQLite Administrator is doing something weird with
booleans. It's making some assumptions, probably generating a varchar(1)
instead. I'm not sure what to do with it.

On Tue, Feb 24, 2009 at 1:58 PM, Pascal Craponne <[email protected]> wrote:

> No, you got the point, the only thing is that this change should probably
> be modular (for example related to an attribute, if Linq to SQL doesn't
> provide such meta info).
> Pascal.
>
> jabber/gtalk: [email protected]
> msn: [email protected]
>
>
>
> On Tue, Feb 24, 2009 at 22:49, Justin Collum <[email protected]> wrote:
>
>> Seems like there is somewhere where a linq statement gets translated into
>> SQL, but translated differently for every target database type. I just need
>> to find that spot and change how it deals with booleans. Or am I totally
>> missing something?
>>
>> On Tue, Feb 24, 2009 at 1:39 PM, Pascal Craponne <[email protected]>wrote:
>>
>>> on some databases, booleans don't even exist, and all of this is just a
>>> convention (Oracle for example, where I have been using 0/1, Y/N, T/F in
>>> different contexts). It is apparently the same thing for SQLite, so
>>> something that works for someone won't work for you, and the opposite is
>>> also true.
>>> The problem is really interesting, probably goes far beyond such a fix.
>>>
>>> Maybe could such differences be handled as attributes (extensions to
>>> DbLinq).
>>> For example:
>>> [Bool(0,1)]
>>> [Bool('N','Y')]
>>> could be attributes used to make differences for such purely conventional
>>> type management.
>>>
>>> I don't have Linq to SQL documentation in mind (and probably being too
>>> lazy to read it now), but I don't think MS implementation needs to handle
>>> such cases.
>>>
>>> For guys new to the project, DbLinq follows to goals:
>>> 1. Being strictly compatible with Linq to SQL, this is called the strict
>>> mode or mono-strict mode.
>>> 2. Add extended features, when there are limitations. Such extensions are
>>> in xxx.Extended.cs files (since those files are not included in strict
>>> builds).
>>>
>>> This is detailed at http://linq.to/db/SxSVersions
>>>
>>> Pascal.
>>>
>>> jabber/gtalk: [email protected]
>>> msn: [email protected]
>>>
>>>
>>>
>>> On Tue, Feb 24, 2009 at 22:28, Justin Collum <[email protected]> wrote:
>>>
>>>> I need to change how booleans are handled in SQLite query generation.
>>>> I've got a boolean field in my table and data object but the query that's
>>>> being generated looks like "MyField = True" where it should be "MyField
>>>> ='Y'". Or am I missing something?
>>>>
>>>> On Tue, Feb 24, 2009 at 12:40 PM, Pascal Craponne <[email protected]>wrote:
>>>>
>>>>> What do you plan to work on, exactly?
>>>>>
>>>>> Pascal.
>>>>>
>>>>> jabber/gtalk: [email protected]
>>>>> msn: [email protected]
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Feb 24, 2009 at 21:17, Justin Collum <[email protected]>wrote:
>>>>>
>>>>>> Great. Do I get a branch so I don't collide with other devs?
>>>>>>
>>>>>> On Tue, Feb 24, 2009 at 12:14 PM, Pascal Craponne 
>>>>>> <[email protected]>wrote:
>>>>>>
>>>>>>> Done. You are now contributor. Also remember that with great power
>>>>>>> comes great responsibility, so be careful with changes, always check 
>>>>>>> unit
>>>>>>> tests before and after the changes, if possible on many databases.
>>>>>>> I didn't have any news from Stefan who was working on a linux VM with
>>>>>>> all databases. It is probably not totally finished, so if someone here 
>>>>>>> has
>>>>>>> enough linux knowledge to finish the job (I have no idea of what 
>>>>>>> databases
>>>>>>> remain to be installer), I'd appreciate.
>>>>>>>
>>>>>>> Pascal.
>>>>>>>
>>>>>>> jabber/gtalk: [email protected]
>>>>>>> msn: [email protected]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Feb 24, 2009 at 21:09, Justin Collum <[email protected]>wrote:
>>>>>>>
>>>>>>>> I'd like to be added in too. I'm working in SQLite and running into
>>>>>>>> some errors with the generation of queries (joins, booleans). Unless 
>>>>>>>> there's
>>>>>>>> someone else working on it? I'm a C# developer, comfortable with unit
>>>>>>>> testing but I don't know the first thing about turning objects into SQL
>>>>>>>> queries. Good for the ol' resume tho, and it'd be nice to help.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Feb 23, 2009 at 1:51 PM, Pascal Craponne 
>>>>>>>> <[email protected]>wrote:
>>>>>>>>
>>>>>>>>> Welcome to Jonathan Pryor, our new contributor :)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Feb 23, 2009 at 21:36, Jonathan Pryor <[email protected]>wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, 2009-02-23 at 10:01 +0100, Pascal Craponne wrote:
>>>>>>>>>> > 3. Jon, provide me a google code identifer, so I can add you to
>>>>>>>>>> > contributors (and I would be very pleased to)
>>>>>>>>>>
>>>>>>>>>> My Google Code identifier is: jonmpryor
>>>>>>>>>>
>>>>>>>>>>  - Jon
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to