Getting Started | Defog Docs #702
Labels
CLI-UX
Command Line Interface user experience and best practices
code-generation
code generation models and tools like copilot and aider
data-validation
Validating data structures and formats
dataset
public datasets and embeddings
software-engineering
Best practice for software engineering
Getting Started | Defog Docs
Description:
Let's discover Defog in less than 5 minutes. Here's a 1-minute demo of the setup.
What you'll need:
If you do not have pip installed on your computer, you can install it here.
Initializing Defog:
Get started by installing our CLI interface.
To do this, just run the following commands on your terminal:
pip install --upgrade 'defog[snowflake]'
If you're not using Snowflake, then you can replace the above with:
pip install --upgrade 'defog[postgres]'
or
pip install --upgrade 'defog[mysql]'
or
pip install --upgrade 'defog[bigquery]'
From here, you can just follow the instructions in the CLI wizard to get started!
Important Note: Doing this does not send your database credentials to Defog! This is only done so we can get your database metadata (table names, column names, column descriptions), and so you can execute the queries generated by Defog locally on your machine.
Generating a CSV file for your metadata:
To generate a CSV file that contains your metadata, just list all the tables names you want, separated by a space.
Once generated, you can edit the CSV to give an accurate description of your metadata. We have included steps to do that in this Cookbook.
Uploading your metadata:
To upload your metadata to Defog, just pass in the path to your CSV via
defog update
.For example, if your CSV is in the current folder as
defog_metadata.csv
, you should just rundefog update defog_metadata.csv
.Making a test query:
Once your metadata has been updated, you can start making test queries. An example query is below:
defog query 'how many users do we have?'
(Optional) Deploying to AWS Lambda or GCP Functions:
If you want to deploy Defog as a microservice on your cloud, you can run the following functions:
Once you do this, you will see the API endpoint for your microservice in your console.
URL: https://docs.defog.ai/getting-started/
Suggested labels
The text was updated successfully, but these errors were encountered: