1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages.ko/common/usql.md

33 lines
831 B
Markdown
Raw Normal View History

# usql
> SQL 데이터베이스를 위한 범용 CLI 인터페이스.
> 더 많은 정보: <https://github.com/xo/usql>.
- 특정 데이터베이스에 연결:
`usql {{sqlserver|mysql|postgres|sqlite3|...}}://{{사용자_명}}:{{비밀번호}}@{{호스트}}:{{포트}}/{{데이터베이스_명}}`
- 파일에서 명령 실행:
`usql --file={{경로/대상/query.sql}}`
- 특정 SQL 명령 실행:
`usql --command="{{sql_명령}}"`
- `usql` 프롬프트에서 SQL 명령 실행:
`{{프롬프트}}=> {{명령}}`
- 데이터베이스 스키마 표시:
`{{프롬프트}}=> \d`
- 특정 파일로 쿼리 결과 내보내기:
`{{프롬프트}}=> \g {{경로/대상/결과_파일}}`
- CSV 파일에서 특정 테이블로 데이터 가져오기:
`{{프롬프트}}=> \copy {{경로/대상/데이터.csv}} {{테이블_명}}`