Good find and good suggestion!

-Colin

Orient Technologies

The Company behind OrientDB


On Thursday, May 7, 2015 at 3:47:09 PM UTC-5, Wayne Werner wrote:
>
> This took me a helluva long time to find... should get this into the 
> select documentation!
>
> On Wednesday, September 11, 2013 at 7:02:32 AM UTC-4, Lvc@ wrote:
>>
>> Hi all,
>> starting from today (develop branch and 1.6.0-SNAPSHOT on sonatype 
>> repository) we've new query the schema and indexes by introducing the new 
>> target prefix "*metadata*" where you can get:
>>
>> - *schema*, to get classes and properties
>> - *indexmanager*, to get information about indexes
>>
>> Get all the configured classes:
>>
>> select expand(classes) from metadata:schema
>>
>>
>> ----+-----------+---------+----------------+----------+--------+--------+----------+----------+------------+----------
>> #   |name       
>> |shortName|defaultClusterId|strictMode|abstract|overSize|clusterIds|properties|customFields|superClass
>>
>> ----+-----------+---------+----------------+----------+--------+--------+----------+----------+------------+----------
>> 0   |UserGroup  |null     |13              |false     |false   |0.0     
>> |[1]       |[2]       |null        |V
>> 1   |WallPost   |null     |15              |false     |false   |0.0     
>> |[1]       |[4]       |null        |V
>> 2   |Owner      |null     |12              |false     |false   |0.0     
>> |[1]       |[1]       |null        |E
>> 3   |OTriggered |null     |-1              |false     |true    |0.0     
>> |[1]       |[0]       |null        |null
>> 4   |E          |E        |10              |false     |false   |0.0     
>> |[1]       |[0]       |null        |null
>> 5   |OUser      |null     |5               |false     |false   |0.0     
>> |[1]       |[4]       |null        |OIdentity
>> 6   |OSchedule  |null     |7               |false     |false   |0.0     
>> |[1]       |[7]       |null        |null
>> 7   |ORestricted|null     |-1              |false     |true    |0.0     
>> |[1]       |[4]       |null        |null
>> 8   |AssignedTo |null     |11              |false     |false   |0.0     
>> |[1]       |[1]       |null        |E
>> 9   |V          |null     |9               |false     |false   |2.0     
>> |[1]       |[0]       |null        |null
>> 10  |OFunction  |null     |6               |false     |false   |0.0     
>> |[1]       |[5]       |null        |null
>> 11  |ORole      |null     |4               |false     |false   |0.0     
>> |[1]       |[4]       |null        |OIdentity
>> 12  |ORIDs      |null     |8               |false     |false   |0.0     
>> |[1]       |[0]       |null        |null
>> 13  |OIdentity  |null     |-1              |false     |true    |0.0     
>> |[1]       |[0]       |null        |null
>> 14  |User       |null     |14              |false     |false   |0.0     
>> |[1]       |[2]       |null        |V
>>
>> ----+-----------+---------+----------------+----------+--------+--------+----------+----------+------------+----------
>>
>> Get all the configured properties for the class OUser:
>>
>> select expand(properties) from (
>>    select expand(classes) from metadata:schema
>> ) where name = 'OUser'
>>
>>
>> ----+--------+----+---------+--------+-------+----+----+------+------------+-----------
>> #   |name    |type|mandatory|readonly|notNull|min |max 
>> |regexp|customFields|linkedClass
>>
>> ----+--------+----+---------+--------+-------+----+----+------+------------+-----------
>> 0   |status  |7   |true     |false   |true   |null|null|null  |null       
>>  |null
>> 1   |roles   |15  |false    |false   |false  |null|null|null  |null       
>>  |ORole
>> 2   |password|7   |true     |false   |true   |null|null|null  |null       
>>  |null
>> 3   |name    |7   |true     |false   |true   |null|null|null  |null       
>>  |null
>>
>> ----+--------+----+---------+--------+-------+----+----+------+------------+-----------
>>
>> Get all the configured indexes:
>>
>> select expand(indexes) from metadata:indexmanager
>>
>>
>> ----+------+------+--------+---------+---------+------------------------------------+------------------------------------------------------
>> #   |@RID  |mapRid|clusters|type     |name     |indexDefinition           
>>           |indexDefinitionClass
>>
>> ----+------+------+--------+---------+---------+------------------------------------+------------------------------------------------------
>> 0   |#-1:-1|#2:0  |[0]     |DICTIO...|dictio...|{keyTypes:[1]}           
>>            |com.orientechnologies.orient.core.index.OSimpleKeyI...
>> 1   |#-1:-1|#1:1  |[1]     |UNIQUE   
>> |OUser....|{className:OUser,field:name,keyTy...|com.orientechnologies.orient.core.index.OPropertyIn...
>> 2   |#-1:-1|#1:0  |[1]     |UNIQUE   
>> |ORole....|{className:ORole,field:name,keyTy...|com.orientechnologies.orient.core.index.OPropertyIn...
>>
>> ----+------+------+--------+---------+---------+------------------------------------+------------------------------------------------------
>>
>> Hope this simple addition will be useful for some users ;-)
>>
>> For more information: 
>> https://github.com/orientechnologies/orientdb/issues/1668
>>
>> Luca Garulli
>> CEO at Orient Technologies
>> the Company behind OrientDB
>> http://about.me/luca.garulli
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to