You need to escape the '?' as it is supposed to be part of the path.
Properly encoded the URL should be:
http://localhost:8080/Customers/%5B%3F(%40.CustomerCode%3C'AB')%5D
However, I make this mistake all the time as well, so I think I am going to
add some code to look for query strings and intrepret it as the user
intended. The error message isn't really that helpful either, but it is
basically trying to parse "[" (because the query string is treated
separately). However, even with right query, I would bet you would encounter
the same problem as test #3.
> test 3: HTTP Range items=0-10
> url: http://localhost:8080/Customers/
> expected: 11 rows
> result: failure
> java.lang.OutOfMemoryError: Java heap space
We definitely need SQL pagination!
Kris
Yeah, it really should all work without escaping. There are some limits, %
and # simply must be properly escaped.
> Would it be possible for Persevere to support an alternative
> "JSONPath" syntax such as
>
> http://host:port/Resource/id?filter=expr&sort=expr
Sure, although that doesn't help with escaping does it?
>> We definitely need SQL pagination!
>
> To do this we need a JSONPath to SQL abstraction, a default
> implementation, and the ability to specify a custom implementation in
> the \config\
>
> Then I can help populate the SQL Server custom implementation.
You are going to write the SQL Server custom implementation? Great, I will
do the other parts!
>> However, even with right query, I would bet you would encounter
>> the same problem as test #3.
> Of course you were right ... however this test is easy to pass for a
> small result set if Persevere constructs a SQL "Where clause".
Yes, that will be included in the JSONPath to SQL conversion.
Thanks,
Kris
>
>
> >
>
Currently Persevere does process JSONPath expression in this manner, passing
expressions to the data source where data sources can create SQL from simple
expressions when possile. However, the relation DB data source plugin does
not support creating SQL from JSONPath expressions yet, only the object DB
data source can do it right now. However, since all the hard work of parsing
JSONPath, sending it to the data source in coherent form, and creating SQL
(for the object db) is already done, it should be quite easy for me to get
it in the relational DB data source, probably could do it next week.
Obviously passing sort expressions through to the database is not supported
yet since we are currently discussing the syntax for such ;), but that is
certainly the intent of sort expressions. There is also definitely room for
improvement as far as translating more complex JSONPath expressions into SQL
(although there will probably always be room for further optimizations in
this area). The nice thing is this can be done without surface changes, it
purely internal optimizations by the datasource implementations.
> Item 2) is harder, as some SQL databases, SQL Server included, dont
> support LIMIT and OFFSET which are needed for pagination by the
> database server. The Rails SQL Server Adapter emulates LIMIT and
> OFFSET via some SQL "gymnastics" [which I can detail if desired] and
> pagination performance on a large dataset is very good.
End-to-end paging is definitely a goal of Persevere, and has been
architected with that in mind, but the SQL side is not in place yet. I would
definitely appreciate any information you can provide on the SQL
"gymnastics" involved in getting cross-browser paging (LIMIT/OFFSET)
working, so that can be properly implemented.
On the client side we have all the pieces in place, Dojo's grid supports
pagination, as does the RestStore that I built which then translates to HTTP
Range/Partial Content transfers, which is supported by Persevere. This is
probably the most important part, since the client server connection is the
biggest bottleneck, but it would definitely be great to get pagination all
the way through to the database.
Thanks,
Kris