---++!! !ParaWorld_Map %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Microcomos Query Language (MQL) | *Title* | Microcomos Query Language (MQL) | | *Author(s)* | LiXizhi | | *Date* | 2008/5/22 | | *File* | script/kids/3DMapSystemApp/API/paraworld.MQL.lua | ---+++ Description MQL is a way to query the same ParaWorld data you can access through the ParaWorldAPI functions, but with a SQL-style interface. In fact, many of the normal API calls are simple wrappers for MQL queries. All of the usual privacy checks are still applied. A typical query looks something like this: <verbatim> select uid,createDate from users where PageIndex = 0 and PageSize = 5 and createDate > '2008-1-1' order by createDate desc </verbatim> So, with all that said, why would you use MQL? The key advantages of using MQL over our more traditional API methods are as follows: * Condensed XML reduces bandwidth and parsing costs. Instead of getting all of the information available about a large set of items, you can get just the fields you want for only the set of items matching a specific condition. You can request the specific set of information by adding constraints to the WHERE clause and only listing certain fields in the SELECT clause. * More complex requests can reduce the number of requests necessary. Often the data that you are trying to get depends upon the results of a previous method call. * Provides a single consistent, unified interface for all of your data. Instead of having to learn numerous different methods that each have their own idiosyncrasies, you can make all of your requests with one function that has a consistent return type. Additionally, if you do need to call any of the traditional methods, the return XML is very similar, so the switching cost is negligible. It's fun! Check out the examples available at paraworld.MQL.query and then try playing around with it in the UnitTest console - you can do some cool stuff with it! %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua"); </verbatim> %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback