Functions

This section describes introspection of functions.

Introspection of the schema::Function:

  1. db>
  2. ...
  3. ...
  4. ...
  5. ...
  6. ...
  7. ...
  8. ...
  9. ...
  10. ...
  11. ...
  1. with module schema
  2. select ObjectType {
  3. name,
  4. links: {
  5. name,
  6. },
  7. properties: {
  8. name,
  9. }
  10. }
  11. filter .name = 'schema::Function';
  1. {
  2. Object {
  3. name: 'schema::Function',
  4. links: {
  5. Object { name: '__type__' },
  6. Object { name: 'annotations' },
  7. Object { name: 'params' },
  8. Object { name: 'return_type' }
  9. },
  10. properties: {
  11. Object { name: 'id' },
  12. Object { name: 'name' },
  13. Object { name: 'return_typemod' }
  14. }
  15. }
  16. }

Since params are quite important to functions, here’s their structure:

  1. db>
  2. ...
  3. ...
  4. ...
  5. ...
  6. ...
  7. ...
  8. ...
  9. ...
  10. ...
  11. ...
  1. with module schema
  2. select ObjectType {
  3. name,
  4. links: {
  5. name,
  6. },
  7. properties: {
  8. name,
  9. }
  10. }
  11. filter .name = 'schema::Parameter';
  1. {
  2. Object {
  3. name: 'schema::Parameter',
  4. links: {
  5. Object { name: '__type__' },
  6. Object { name: 'type' }
  7. },
  8. properties: {
  9. Object { name: 'default' },
  10. Object { name: 'id' },
  11. Object { name: 'kind' },
  12. Object { name: 'name' },
  13. Object { name: 'num' },
  14. Object { name: 'typemod' }
  15. }
  16. }
  17. }

Introspection of the built-in count():

  1. db>
  2. ...
  3. ...
  4. ...
  5. ...
  6. ...
  7. ...
  8. ...
  9. ...
  10. ...
  11. ...
  12. ...
  13. ...
  14. ...
  15. ...
  16. ...
  1. with module schema
  2. select `Function` {
  3. name,
  4. annotations: { name, @value },
  5. params: {
  6. kind,
  7. name,
  8. num,
  9. typemod,
  10. type: { name },
  11. default,
  12. },
  13. return_typemod,
  14. return_type: { name },
  15. }
  16. filter .name = 'std::count';
  1. {
  2. Object {
  3. name: 'std::count',
  4. annotations: {},
  5. params: {
  6. Object {
  7. kind: 'PositionalParam',
  8. name: 's',
  9. num: 0,
  10. typemod: 'SetOfType',
  11. type: Object { name: 'anytype' },
  12. default: {}
  13. }
  14. },
  15. return_typemod: 'SingletonType',
  16. return_type: Object { name: 'std::int64' }
  17. }
  18. }

See also

Schema > Functions

SDL > Functions

DDL > Functions

Reference > Function calls

Cheatsheets > Functions