Skip to content

What's a Syncer?

CS Tools interacts with your ThoughtSpot cluster through the V2.0 REST APIs. Oftentimes the data that comes back from an API cannot exposed directly back to analytics tools like ThoughtSpot, because it's in the wrong shape. Additionally, ThoughtSpot requires that your data be stored in a database in order to ask questions of it.

  • CS Tools takes the responsibility of reshaping that data into a tabular format
  • Syncers abstract the details of how to read and write from popular tabular data formats.

We've implemented Syncers to many popular data stores, including many of the Connection types that ThoughtSpot supports.


syncer-architecture


How do I use Syncers?

All Syncers require configuration.

CS Tools commands which support interacting with data stores will provide a --syncer parameter.

The value you pass to it will look similar to a URL you would type in your browser.

The dialect of the data store you want to interact with.

cs_tools tools searchable metadata --syncer "sqlite://database_path=thoughtspot.db"

It.. separates 😅

cs_tools tools searchable metadata --syncer "sqlite://database_path=thoughtspot.db"

The configuration information in order to interact with the data stores.

cs_tools tools searchable metadata --syncer "sqlite://database_path=thoughtspot.db"

The configuration information in order to interact with the data stores.

cs_tools tools searchable metadata --syncer "sqlite://syncer-overwrite.toml"

How do I use the Syncer in commands?

CS Tools accepts syncer definitions in either declarative or configuration file form.

Find the copy button to the right of the code block.

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "csv://directory=.&delimiter=|" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    directory = "."
    delimiter = "|"
    escape_character = "\\"
    empty_as_null = true
    quoting = "ALL"
    date_time_format = "%Y-%m-%dT%H:%M:%S%z"
    header = false
    save_strategy = "APPEND"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer csv://syncer-overwrite.toml --config dogfood
    

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "excel://filepath=searchable.xlsx" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    filepath = "searchable.xlsx"
    filepath_suffix = "--generated-on-%Y-%m-%d"
    date_time_format = "%Y-%m-%dT%H:%M:%S%z"
    save_strategy = "OVERWRITE"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer excel://syncer-overwrite.toml --config dogfood
    

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "json://directory=." --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    directory = "."
    encoding = "UTF-8"
    indentation = 2
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer json://syncer-overwrite.toml --config dogfood
    

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "sqlite://database_path=thoughtspot.db" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    database_path = "thoughtspot.db"
    pragma_speedy_inserts = true
    load_strategy = "TRUNCATE"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer sqlite://syncer-overwrite.toml --config dogfood
    

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "snowflake://account_name=thoughtspot&username=tsadmin&warehouse=ETL_WH&role=ACCT_DATA_LOADER&authentication=basic&database=thoughtspot&schema=cs_tools&secret=[redacted]" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    account_name = "thoughtspot"
    username = "tsadmin"
    warehouse = "ETL_WH"
    role = "ACCT_DATA_LOADER"
    authentication = "basic"
    database = "thoughtspot"
    schema = "cs_tools"
    secret = "[redacted]"
    # private_key_path = ...
    log_level = "info"
    temp_dir = "/tmp"
    load_strategy = "TRUNCATE"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer snowflake://syncer-overwrite.toml --config dogfood