Re: Schema/QB: table:field vs. table.field

"Piotras" <pp-VVDi8QVAvoBWk0Htik3J/[email protected]> Mon, 13 Feb 2006 20:10:59 +0100 (CET)
Newsgroups gmane.comp.web.midgard.devel
Message-ID <[email protected]>
> On Feb 13, 2006, at 19:37, Torben Nehmer wrote:
>> in one of the recent lists on this list (I'm too lazy to look up
>> the actual mail
>> now) there was some code example about the QB in respect with
>> metadata and with
>> joined tables, the synatx there was (if I remember right)
>> metadata:fielname vs.
>> tablename.fieldname (or vice versa).
>>
>> Why is there a distinction between these two cases in syntax?

http://www.midgard-project.org/documentation/midgardquerybuilder-complex-constraints/
( A few details missed , but it's on my TODO list )

> Because metadata is semantically different that joined tables. Joined
> tables are connections between data, but metadata is data about that.
>
> Therefore different syntax is justified so people don't think
> metadata is just "yet another MgdSchema type".

midgard_metadata is an object itself so I wanted to keep some logic.

&(this.syntax); uses dot as object->property "separator"
and all in all very similiar to java

I think we can also support other properties with object type.

colon separator is reserved for referenced types , which are not property's value
but property's value points to other types' identifier. It should be also reserved
for object's "extensions" like attachment or parameter.

I do not know if that sounds sensible , but in theory we could make support for
something like query attachment of an object which is property of another one.

add_constraint("property.object_property:attachment.metadata.created",...)

Piotras