OrientDB: Creating Graph-database through HTTP-API - rest

It seems it is only possible to create document-type databases via the HTTP-api. The documentation omit's information about whether the database will be created as a graph or a documentdatabase, but when creating a vertext, i get the error:
Super-class V not exists
...which, as i understand, means that the database is a document-type.
Is there any way around this? The /command/ action makes it pretty easy for me to do what I want from C#, if I could only generate a graph-database via HTTP-api...
Is there any way to create a graph-database through the HTTP-API?
Alternatively: Is there another way to create a graph-database from c#? I've tried creating a database via the console, but here i get IllegalArgumentException:
Error: java.lang.IllegalArgumentException: Storage type 'plocal' is different by storage type in URL
..which i cannot find any explenation for
Any help is much appreciated :)

I managed to have that using POST http://localhost:2480/database/<db name>/plocal/graph
I did found it experimentally. Did not found that in documentation which is a bit strange.
Tested on version 2.1.7

I got the same error message when I typed in the following command:
create database REMOTE:localhost/petshop root aaaa plocal document
Solution:
I had to write it in lower case:
create database remote:localhost/petshop root aaaa plocal document

Related

MongoDB Atlas scheduled trigger service returning undefined

I’m trying to create a scheduled trigger to clear a collection weekly, but I am unable to get the service…
const collection = context.services.get('mongodb-atlas'); is returning undefined when I log it to console, and when I try and using it, it just says Cannot access member ‘db’ of undefined. I’ve also tried setting the service name to Cluster0 and mongodb-datalake, neither of which worked.
If someone could lend a hand on what I’m doing wrong and how I’m meant to do this, that would be awesome. Thanks.
You need the following syntax to get to your collection:
const collection = context.services.get(<SERVICE_NAME>).db("db_name").collection("coll_name");
SERVICE_NAME you can find from here:
Go into Realm tab
In the left navigation, click on Linked Data Sources
Copy the Realm Service Name

SAP Cloud Application Programming Model Integration

I try to integrate already implemented SAPUI5 application with CAP in order to use SQLite database. In my models I have a property called Order and as you may know, Order is a reserved keyword in SQLite.
entity MyEntity{
key ID : Integer;
Name: localized String(111);
Order: Integer;
}
When I try to use the following command to generate the database:
cds deploy --to sqlite:db/mydb.db
I get the syntax error:
[ERROR] SQLITE_ERROR: near "Order": syntax error
When I use the quotation in my defined entity, then I get an error which regards to SAP HANA database:
[ERROR] cds compile failed due to these errors...
at db\schema.cds:23:3-10: Quoted identifiers are not allowed in plain mode of toHana: "Order"
I just wanted to know is there anyway to solve the issue?
PS: I do not want to use HANA database, so please let me know if there is anyway to disable it, because I could not find any information in this regards.
I appreciate any help or advice :)
In the package.json of your application's root folder, you might have mentioned HANA as the productive DB 'kind'. Try changing it to SQLite.

Cannot use folder-name field to filter resources in HP QC REST API

I don't expect to get an answer on this but if anyone can help it would be greatly appreciated.
We're using HP Application Lifecycle Management 12.2 (ALM or QC/QualityCenter as it's called). I'm trying to retrieve test resources from the project using the REST api but I suspect I've come across a defect in the API.
I'm trying to filter the response by using a query, and any other query works fine but when I try to use the 'folder-name' field it fails with the following message:
Failed to set params in the parametrized query
It doesn't matter what format I try to escape the query with, I've tried the following:
/resources/?query={folder-name[%27folder%27]}
/resources/?query={folder-name['folder']}
/resources/?query=%7bfolder-name%5b%27folder%27%5d%7d
I've also reproduced this on an 11.52 QC instance so it's not just our environment. I've double checked the customization collection using the ?can-filter=true param and folder-name is supposed to be filterable.
I'm currently using the parent-id for filtering instead which works but it requires me to do another request to get the parent-id first which I would like to refrain from.
Any suggestions, patches?
Thanks
As I wrote in the comments, the error is reproducable here, and I agree that it is strange. The folder-name exists as a field in resource, and should be filterable. It seems to be a bug.
But there is another approach that I offer as a substitute solution. The resource entity offer a relation directly to the folder entity, and you can get the exact result you were looking for, by using a cross join with that table:
/resources/?query={resource-folder.name['folder']}
This is probably too late to help you with your work, but it might help others.

Copying data from S3 to Redshift

I feel like this should be a lot easier than it's been on me.
copy table
from 's3://s3-us-west-1.amazonaws.com/bucketname/filename.csv'
CREDENTIALS 'aws_access_key_id=my-access;aws_secret_access_key=my-secret'
REGION 'us-west-1';
Note I added the REGION section after having a problem but did nothing.
Where I am confused though is that in the bucket properties there is only the https://path/to/the/file.csv. I can only assume that all the documentation that I have read calling for the path to start with s3://... that I would just change https to s3 like shown in my example.
However I get this error:
"Error : ERROR: S3ServiceException:
The bucket you are attempting to access must be addressed using the specified endpoint.
Please send all future requests to this endpoint.,Status 301,Error PermanentRedirect,Rid"
I am using navicat for PostgreSQL to connect to Redshift and Im running on a mac.
The S3 path should be 's3://bucketname/filename.csv'. Try this.
Yes, It should be a lot easier :-)
I have only seen this error when your S3 bucket is not in US Standard. In such cases you need to use endpoint based address e.g. http://s3-eu-west-1.amazonaws.com/mybucket/myfile.txt.
You can find the endpoints for your region in this documentation page,
http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

SugarCRM Querying Database

In SugarCRM, using SOAP API, imagining i have lots of accounts populated in the database, and i want to find the account that has 'phone_work' = '00352254856987'. How can i make a query to accomplish that? It would be something like this:?
$query = "phone_work = '${myPhone}'";
For what i have tried, it seems the compiler finds an error in the XML document, which means the query is not well executed. What is the best way to do this kind of queries?
I'm using magento and creating a module to connect to sugar, so it is PHP
It turned out the field 'phone_work' is wrong. You can access at: http://apidocs.sugarcrm.com/schema/6.3.0/pro/tables/accounts.html and get all the fields related to that module. In the module 'Accounts', the field name is called 'office phone', but in the database, the name is 'phone_office'. Because the query is for the database, we need to use database field names.
Could you post the error that you get? Take also a look at the sugarcrm.log and maybe increase the logging level to see if the sql that gets created from your query is wrong.
By the way I switched to REST Json to get rid of soap related problems.