Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sixcolors/orasuck


https://github.com/sixcolors/orasuck

Last synced: 11 days ago
JSON representation

Awesome Lists containing this project

README

        

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

Table of Contents



  1. About The Project



  2. Getting Started


  3. Usage

  4. Roadmap


  5. Contributing


  6. License

  7. Contact

  8. Acknowledgments

## About The Project

I needed a simple executable to explore and export data from an Oracle DB on a locked down corporate laptop/network. This was my starting point for an automated data retrieval program which I can't share publicly. This repo is public in hopes that someone else will find it useful.

Here's why:
* Oracle CLI produces broken CSV files
* Oracle Developer didn't work for me either.
* This is lightweight and simple;

Of course, no one tool will serve all projects since your needs may be different. So you may also suggest changes by forking this repo and creating a pull request or opening an issue.

(back to top)

### Built With

* [Go](https://golang.org/)

(back to top)

## Getting Started

To get a local copy up and running follow these simple example steps.

### Prerequisites

You will need to install Go.
* go
Install Go

### Installation

To get this up and running:

1. Clone the repo
```sh
git clone https://github.com/sixcolors/orasuck.git
```
2. Install Go mods
```sh
go mod tidy
```
3. Build orasuck
```sh
go build -o orasuck main.go
```

* for windows
```sh
GOOS=windows GOARCH=386 go build -o orasuck.exe main.go
```

(back to top)

## Usage

* Query and display (pretty) to stdout
```sh
orasuck -server "oracle://user:pass@server/service_name" "select * from my_table"
```

* Query and export to csv file
```sh
orasuck -server "oracle://user:pass@server/service_name" -file "out.csv" "select * from my_table"
```

(back to top)

## Roadmap

- [x] Initial Release

See the [open issues](https://github.com/sixcolors/orasuck/issues) for a full list of proposed features (and known issues).

(back to top)

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

(back to top)

### Testing

We can test Orasuck using Oracle Database Free Edition. For more information, see [Oracle Database Free Release Quickstart](https://www.oracle.com/database/free/get-started/#quick-start).

Run the Oracle DB container.

```sh
docker run --name oracle -p 1521:1521 -e ORACLE_PWD=Test123 container-registry.oracle.com/database/free:latest
```

Connect to the Oracle DB container.

```sh
docker exec -it oracle bash
```

Connect to the Oracle DB.

```sh
sqlplus sys@localhost:1521/FREE as sysdba
```

Create a user and grant privileges.

```sql
alter session set "_ORACLE_SCRIPT"=true;
CREATE USER test IDENTIFIED BY Test123;
GRANT CONNECT, RESOURCE TO test;
ALTER USER test QUOTA UNLIMITED ON USERS;
```

Create a table and insert some data.

```sql
CREATE TABLE test.test_table (id NUMBER, name VARCHAR2(50));
INSERT INTO test.test_table VALUES (1, 'John Doe');
INSERT INTO test.test_table VALUES (2, 'Jane Doe');
```

Grant select privileges.

```sql
GRANT SELECT ON test.test_table TO test;
```

Test the connection.

```sh
go run main.go -server "oracle://test:Test123@localhost:1521/FREE" "select * from test_table"
```

(back to top)

## License

Distributed under the MIT License. See `LICENSE.txt` for more information.

(back to top)

## Contact

@sixcolors

Project Link: [https://github.com/sixcolors/orasuck](https://github.com/sixcolors/orasuck)

(back to top)

## Acknowledgments

I've used the following projects as dependencies.

* [sijms/go-ora](github.com/sijms/go-ora)
* [schollz/progressbar](github.com/schollz/progressbar/v3)

(back to top)

[contributors-shield]: https://img.shields.io/github/contributors/sixcolors/orasuck.svg?style=for-the-badge
[contributors-url]: https://github.com/sixcolors/orasuck/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/sixcolors/orasuck.svg?style=for-the-badge
[forks-url]: https://github.com/sixcolors/orasuck/network/members
[stars-shield]: https://img.shields.io/github/stars/sixcolors/orasuck.svg?style=for-the-badge
[stars-url]: https://github.com/sixcolors/orasuck/stargazers
[issues-shield]: https://img.shields.io/github/issues/sixcolors/orasuck.svg?style=for-the-badge
[issues-url]: https://github.com/sixcolors/orasuck/issues
[license-shield]: https://img.shields.io/github/license/sixcolors/orasuck.svg?style=for-the-badge
[license-url]: https://github.com/sixcolors/orasuck/blob/master/LICENSE.txt
[product-screenshot]: images/screenshot.png