astromodule.splus.SplusService.query#
- SplusService.query(sql: str, save_path: str | Path, replace: bool = False, scope: Literal['public', 'private'] = 'public', table=None, fmt: str = 'text/csv')[source]#
- Sends a single query to splus.cloud database - Parameters:
- sql: str
- The sql query string 
- save_path: str or Path
- The path where the query output will be saved 
- repalace: bool (optional)
- This method checks if a file exists in - save_pathlocation before the download. If this parameters is- Trueand a file exists in- save_pathlocation, this method will ovewrite the existing file. If this parameter is- Falseand a file exists in- save_pathlocation, this method will skip the download. Default to- False
- scope: str (optional)
- The splus.cloud scope. Can be - publicor- private. Use- privateonly if you are assigned as collaborator. Defaults to- public
- fmt: str (optional)
- The mimi-type of query output. Defaults to - text/csv
 
 - Examples - >>> service.query('SELECT TOP 10 * FROM dr1.all_dr1', 'query.csv') 
