Skip to content

[WIP] New SQL command DESCRIBE DATABASE#1485

Closed
gramian wants to merge 1 commit intoArcadeData:mainfrom
gramian:describe
Closed

[WIP] New SQL command DESCRIBE DATABASE#1485
gramian wants to merge 1 commit intoArcadeData:mainfrom
gramian:describe

Conversation

@gramian
Copy link
Collaborator

@gramian gramian commented Feb 28, 2024

What does this PR do?

This change adds a new SQL command DESCRIBE DATABASE which returns the value of the also new setting arcadedb.databaseDescription.

Motivation

I wanted a way to convey overall database metadata / comments to a user in a unified way. In standard SQL the command DESCRIBE DATABASE is used to return schema info but semantically "Describe" fits the function rather well.

Additional Notes

  • This PR is Work-in-Progress

  • Add tests

  • @lvca WDYT?

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@lvca
Copy link
Member

lvca commented Feb 29, 2024

Do you mean a describe command like with Oracle?

https://docs.oracle.com/en/database/oracle/oracle-database/19/sqpug/DESCRIBE.html#GUID-2E7032A1-67E9-4E13-96B6-D8F7B138ECAA

Used as describe <type-name|index-name|property-name> ?

@gramian
Copy link
Collaborator Author

gramian commented Feb 29, 2024

Hi

no it works more like this: https://impala.apache.org/docs/build/html/topics/impala_describe.html

But instead of using COMMENT ON DATABASE mydb IS 'bla bla', here I propose to use ALTER DATABASE `arcadedb.databaseDescription` 'bla bla'

And instead of DESCRIBE DATABASE mydb I propose to just use DESCRIBE DATABASE as I can only send SQL queries once I am "in" a database already. Also, this command just returns the comment and not the database name (as you are logged into it) and not the database location (this should be unnecessary info for a user).

@lvca
Copy link
Member

lvca commented Feb 29, 2024

What's the purpose of returning a string you set in the settings?

@gramian
Copy link
Collaborator Author

gramian commented Feb 29, 2024

It is supposed to serve as a unified entry point for new users of a database to learn how to get started.

I would put things like this into the description:

This database contains data about X. The central type is the Y vertex (see schema). The types A, B, C are only for purpose P. ...

@gramian
Copy link
Collaborator Author

gramian commented Feb 29, 2024

If you are skeptical with this new command. How about just adding a database setting called databaseDescription?

Since ALTER DATABASE does not support custom attributes there seems to be no other way to store a database global comment.

@gramian gramian mentioned this pull request Feb 29, 2024
2 tasks
@gramian gramian closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants