Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/kind-zoos-change.md

This file was deleted.

10 changes: 10 additions & 0 deletions .changeset/ten-tables-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@sqlanydb-tools/tsconfig": major
"@sqlanydb-tools/sqlanydb-manager": major
"@sqlanydb-tools/sqlanydb-config": major
"@sqlanydb-tools/sqlanydb-utils": major
"sqlanydb-tools-vscode": major
"@sqlanydb-tools/cli": major
---

Changed bundler from WebPack to Rollup and implemented Result<T,E> pattern for error handling
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ apps/sqlanydb-manager/src/config.json
!.vscode/*.code-snippets
.history/
.history
.ionide
.ionide

# CLI config
apps/cli/src/config.json
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"importOrder": ["^@sqlanydb-tools/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

28 changes: 13 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/apps/sqlanydb-tools-vscode"
],
"outFiles": [
"${workspaceFolder}/apps/sqlanydb-tools-vscode/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/apps/vscode"
],
"outFiles": ["${workspaceFolder}/apps/vscode/dist/**/*.js"],
"preLaunchTask": "npm: build"
}
]
}
38 changes: 0 additions & 38 deletions .vscode/tasks.json

This file was deleted.

88 changes: 49 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,56 @@
<div align="center">

# SQL Anywhere Tools

##### Complete toolbox for SAP SQL Anwyhere 17

<img alt="sqlanydb-tools-logo" height="280" src="./assets/sqlanydb-tools-logo.png" />
</div>

# Project Description

The SQL Anywhere Tools project is a comprehensive suite of tools designed to simplify and streamline the management and development of SAP SQL Anywhere 17 databases. This project consists of a set of CLI tools for common database operations and a VSCode extension that integrates all of these tools into a seamless development environment.

By bundling both command-line utilities and an integrated VSCode experience in a single monorepo, this toolbox enables developers and DBAs to perform essential tasks more efficiently, whether working directly with the command line or within their IDE.

# Table Of Contents
- [SQL Anywhere Tools](#sql-anywhere-tools)
- [Complete toolbox for SAP SQL Anwyhere 17](#complete-toolbox-for-sap-sql-anwyhere-17)
- [Project Description](#project-description)
- [Table Of Contents](#table-of-contents)
- [Feature Roadmap](#feature-roadmap)
- [Installation](#installation)
- [VSCode extension](#vscode-extension)
- [sqlanydb-manager CLI](#sqlanydb-manager-cli)
- [Usage](#usage)
- [Development](#development)
- [Prerequisites](#prerequisites)
- [Development Environment Setup](#development-environment-setup)
- [Running the CLI tools](#running-the-cli-tools)
- [sqlanydb-manager](#sqlanydb-manager)
- [Running the VSCode extension](#running-the-vscode-extension)
- [License](#license)

- [SQL Anywhere Tools](#sql-anywhere-tools) - [Complete toolbox for SAP SQL Anwyhere 17](#complete-toolbox-for-sap-sql-anwyhere-17)
- [Project Description](#project-description)
- [Table Of Contents](#table-of-contents)
- [Feature Roadmap](#feature-roadmap)
- [Installation](#installation)
- [VSCode extension](#vscode-extension)
- [sqlanydb-manager CLI](#sqlanydb-manager-cli)
- [Usage](#usage)
- [Development](#development)
- [Prerequisites](#prerequisites)
- [Development Environment Setup](#development-environment-setup)
- [Running the CLI tools](#running-the-cli-tools)
- [sqlanydb-manager](#sqlanydb-manager)
- [Running the VSCode extension](#running-the-vscode-extension)
- [License](#license)

# Feature Roadmap
- sqlanydb-manager CLI tool: start, stop, reset and ping local databases [X]
- accompanying feature support in sqlanydb-tools-vscode extension [X]
- database connector through sajdbc4.jar & dbjdbc17.jar included with sql anywhere [ ]
- accompanying feature support to run queries in sqlanydb-tools-vscode extension [ ]
- sql anywhere language parser with ANTLR [ ]
- accompanying syntax highlighting in sqlanydb-tools-vscode extension [ ]
- prettier-plugin-sqlanydb for sql anywhere auto formatting support [ ]
- LSP to suggest autocompletions based on database schema [ ]
- sqlanydb-migrator CLI tool: migration support for database development [ ]
- accompanying feature support in sqlanydb-tools-vscode extension [ ]
- database explorer in sqlanydb-tools-vscode-extension [ ]

- sqlanydb-manager CLI tool: start, stop, reset and ping local databases [X]
- accompanying feature support in sqlanydb-tools-vscode extension [X]
- database connector through sajdbc4.jar & dbjdbc17.jar included with sql anywhere [ ]
- accompanying feature support to run queries in sqlanydb-tools-vscode extension [ ]
- sql anywhere language parser with ANTLR [ ]
- accompanying syntax highlighting in sqlanydb-tools-vscode extension [ ]
- prettier-plugin-sqlanydb for sql anywhere auto formatting support [ ]
- LSP to suggest autocompletions based on database schema [ ]
- sqlanydb-migrator CLI tool: migration support for database development [ ]
- accompanying feature support in sqlanydb-tools-vscode extension [ ]
- database explorer in sqlanydb-tools-vscode-extension [ ]

# Installation

## VSCode extension

There are 2 ways to install the VSCode extension:

1. Navigate to the `Extensions` tab in VSCode and search for `sqlanydb-tools-vscode`
2. Download the VSIX file from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=dwarf1er.sqlanydb-tools-vscode)

Expand All @@ -63,22 +67,22 @@ There are 2 ways to install the VSCode extension:
## Prerequisites

1. SAP SQL Anywhere 17
You will need to have SAP SQL Anywhere 17 installed on your machine. You can obtain a developer license [here](https://www.sqlanywhere.info/EN/sql-anywhere/sql-anywhere-trial.html)
You will need to have SAP SQL Anywhere 17 installed on your machine. You can obtain a developer license [here](https://www.sqlanywhere.info/EN/sql-anywhere/sql-anywhere-trial.html)
2. Create a SAP SQL Anywhere 17 Development Databse
Once you have installed SAP SQL Anywhere 17, open `SQL Central` and in the top bar of the application go to `Tools > SQL Anwyhere 17 > Create Database...` and follow the prompts
2. Node.JS (version 22.9.0)
You can check your NodeJS version with the following command:
Once you have installed SAP SQL Anywhere 17, open `SQL Central` and in the top bar of the application go to `Tools > SQL Anwyhere 17 > Create Database...` and follow the prompts
3. Node.JS (version 22.9.0)
You can check your NodeJS version with the following command:
```bash
node -v
```
If you don't have the required version you can install it from the official [Node.JS website](https://nodejs.org) or use a node version manager like [nvm](https://github.com/nvm-sh/nvm) or [nvm for windows](https://github.com/coreybutler/nvm-windows) to manage multiple versions.
3. Turborepo
This project uses [turbo](https://turbo.build) to manage and build multiple packages in the monorepo efficiently. You will need to install turborepo globally:
4. Turborepo
This project uses [turbo](https://turbo.build) to manage and build multiple packages in the monorepo efficiently. You will need to install turborepo globally:
```bash
npm install -g turbo
```
4. ts-node
To make it easier to run and test the CLI and packages written in TypeScript, we recommend using [ts-node](https://www.npmjs.com/package/ts-node). You will need to install it globally:
5. ts-node
To make it easier to run and test the CLI and packages written in TypeScript, we recommend using [ts-node](https://www.npmjs.com/package/ts-node). You will need to install it globally:
```bash
npm install -g ts-node
```
Expand All @@ -98,14 +102,14 @@ Once you have all the prerequisites installed, follow these steps to get your de
3. Build the project
```bash
turbo run build
```
```

## Running the CLI tools

To run the command-line tools locally, use the following command:
```bash
`bash
ts-node /path/to/clit-tools.ts
```
`

### sqlanydb-manager

Expand All @@ -119,4 +123,10 @@ When working on this project in VSCode you can press `F5` to launch the extensio

# License

This project is licensed under the [MIT License](LICENSE)
This project is licensed under the [MIT License](LICENSE)

# Acknowledgements

- A massive shoutout to [alexandre-lavoie](https://github.com/alexandre-lavoie/) for rescuing me from the depths of my own misguided "brilliance"! Your help on restructuring this project transformed the chaos into something that actually works.

Check out [alexandre-lavoie's](https://github.com/alexandre-lavoie/) awesome projects [here](https://github.com/alexandre-lavoie?tab=repositories)!
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@sqlanydb-tools/cli",
"version": "1.0.0",
"keywords": [],
"author": "",
"license": "MIT",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"dev": "rollup --watch --config rollup.config.ts --bundleConfigAsCjs --configPlugin @rollup/plugin-typescript",
"build": "rollup --config rollup.config.ts --bundleConfigAsCjs --configPlugin @rollup/plugin-typescript"
},
"dependencies": {
"@sqlanydb-tools/sqlanydb-config": "*",
"@sqlanydb-tools/sqlanydb-manager": "*",
"@sqlanydb-tools/sqlanydb-utils": "*",
"commander": "^12.1.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-typescript": "^12.1.1",
"rollup": "^4.24.0",
"@sqlanydb-tools/tsconfig": "*"
}
}
24 changes: 24 additions & 0 deletions apps/cli/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import { RollupOptions } from "rollup";

const production = !process.env.ROLLUP_WATCH;

const config: RollupOptions = {
input: "src/index.ts",
output: {
dir: "dist",
format: "cjs",
sourcemap: !production,
},
plugins: [
resolve({
resolveOnly: [/^@sqlanydb-tools/],
}),
typescript(),
commonjs(),
],
};

export default config;
Loading