Tutorial

  • Introduction & Tips

    Access

    Avabot provides read only access. Your team cannot modify, update, or write to your databases through Avabot.

    Messaging

    You can talk to Avabot by direct messaging Avabot, or in a channel by using tagging Avabot by saying @avabot before your message. For example you can run a SQL query in a channel by saying: “@avabot SELECT * FROM employees”

    Parameters

    When map queries, or using labels, be sure to wrap any variables or parameters in { }s so Avabot can read your request and get you the correct data.

    Databases

    You can set up as many databases as you want with Avabot. When running queries you’ll have the option of choosing which database to run your query on.

  • Database Integration

    Setup Database

    You can integrate new databases by saying “setup database”. If you’re doing this in a channel that is not a direct message to Avabot, but sure to tag Avabot with the @avabot tag before your command. Note: If it’s your first time integrating Avabot, you’ll automatically be asked to integrate a database.

    Avabot can be integrated with mySQL, Postgres, or Redshift. If there is a connection type that you’re looking for please contact us and we’ll work to get it integrated for you right away.

    Things you’ll need to integrate a database include: • Name for your connection: you can name your connection anything you want. Naming your connection helps in the case that you have multiple databases integrated with Avabot. • Host • Username • Password • Port

    If you don’t have this information, anyone on your team can integrate the database so simple ask a teammate to message Avabot, and he/she will be able to get your connection setup.

  • Run Query

    You can run query by messaging Avabot your query directly or by tagging Ava in a channel by saying: “@avabot your-sql-query”

    If you have multiple databases integrated Avabot will first ask you which database you would like to run your query on

    You can also run a query by first direct messaging Avabot “run query” or tagging Avabot in a channel by saying “@avabot run query”. If you have only one database integrated Ava will ask you what SQL query you would like to run. If you have more than one database integrated, Ava will first ask you which database you would like to run your query on.

  • Map Query

    Mapping Queries is one of the best features of Avabot. If you use a SQL query very often, you can save it in English so that you and the rest of your team can use it at any time. Mapped queries can be pulled up by using the “show labels” or “top labels” command and you can swap out variables/parameters in each of the saved English queries.

    Start by direct messaging Avabot “map query” or by tagging Avabot in a channel by saying “@avabot map query”. If you have more than one database integrated, Avabot will first ask you on which database you would like to map your query.

    Next, enter the SQL query that you would like Avabot to save. On our examples database we’ve run the query: SELECT * FROM employees WHERE age > 30 to find any employees that are over the age of 30.

    Next Avabot will ask you what you want to label the query. It’s important here that you wrap any variables/parameters in { } so you can use the label with any parameters later on. A good label for our example query might be: show the employees that are over the age of {30}.

    Now that our label is saved you, or anyone on your team can call it at any time with any parameters. For example:

  • Labels

    Use Labels

    You can use a label at any time by direct messaging Avabot the label or in a channel by tagging Avabot by saying “@avabot your-label”

    Note that variables/parameters are wrapped in { }s so any time you call a label, be sure you’re wrapping your parameters. For example a label might be: show employees that are over {age}.

    If you wanted employees that are over the age of 50 you would simply message Avabot: “show employees that are over {50}”.

    Show Labels

    The show labels command is an easy way to see all of the labels that you and your team members have labeled. You can call show labels by direct messaging Avabot “show labels” or by tagging Avabot in a channel by saying “@avabot show labels”.

    Note that variables/parameters are wrapped in { }s so any time you call a label, be sure you’re wrapping your parameters. For example a label might be: show employees that are over {age}.

    If you wanted employees that are over the age of 50 you would simply message Avabot: “show employees that are over {50}”.

    Top Labels

    Top labels is very similar to show labels, however this is a list of the top 5 labels used on your team. Use this command to quickly access commonly used labels on your team. You can call top labels by direct messaging Avabot “top labels” or by tagging Avabot in a channel by saying “@avabot top labels”.

    Note that variables/parameters are wrapped in { }s so any time you call a label, be sure you’re wrapping your parameters. For example a label might be: show employees that are over {age}.

    If you wanted employees that are over the age of 50 you would simply message Avabot: “show employees that are over {50}”.

  • Show Schema

    The show schema command is a great way to get insights to the structure of your database tables. Start by direct messaging Avabot “show schema” or by tagging Avabot in a channel by saying “@avabot show schema”.

    If you have more than one database connected, Avabot will first ask you which database you’d like to find a table schema for.

    Next Avabot will ask you which table you’d like to show schema for. This is enabled to prevent companies with large databases from receiving hundreds of schema messages.

  • Scheduling/Reports

    Scheduling queries is a great way to keep up to date with your company’s data. Avabot can schedule reports to run daily or weekly automatically with just a few simple steps

    Setup Schedule

    To schedule a new query, start by messaging Avabot in the channel that you want the scheduled query to run. You can have the scheduled query run in a direct message by simply messaging Avabot “setup schedule” or in a specific team channel by tagging Avabot in that channel by saying: “@avabot setup schedule”.

    Next Avabot will ask you whether you want to schedule a saved (labeled) query or a raw query. A saved query is a query that you’ve previously mapped. A raw query is a brand new SQL query. If you choose raw, you’ll be prompted to enter your SQL code.

    Next Avabot will ask you whether you want to schedule your query to run daily or weekly. If you choose weekly, please enter the day you want to run the query first.

    Avabot will then ask you what time you want the query to run each day that it is scheduled for. Note: Avabot currently only supports Pacific Standard time, so if you’re in a different timezone please take this into consideration.

    Once you enter a time your query is all setup! You can delete a scheduled query by using the “delete” function.

    Show Schedule

    If you’d like to see what queries you have scheduled to run, simply message Avabot directly or tag avabot in a channel with the command “show schedule”.

  • Delete/Remove

    You can delete a database connection, saved query, or scheduled query by messaging Avabot “remove”. Avabot will then guide you through the delete process. Please note that once you remove a database, saved query, or scheduled query, it will be gone forever.