RestDB4J is a lightweight and scalable solution for interacting with relational databases using a RESTful API. It abstracts the complexities of direct database connections, allowing developers to perform operations like querying, inserting, updating, and deleting through HTTP/REST calls.
In the modern world, integration between applications is a fundamental aspect of creating agile and efficient solutions. Relational databases play a critical role as repositories of structured information. However, direct access can be challenging, especially in scenarios requiring decentralized and secure communication.
RestDB4J simplifies interactions with relational databases by providing a RESTful interface. It supports common database operations like querying, inserting, updating, and deleting. The solution is ideal for teams seeking to access or manipulate data without managing drivers, SQL languages, or complex configurations.
- Interoperability: Support for various relational databases (MySQL, PostgreSQL, SQL Server, etc.).
- Ease of Use: Perform database operations through REST endpoints.
- Standardization: Unified interface for consistent communication.
- Security: Configurable access control to protect data.
- Scalability: Perfect for distributed applications and microservices.
Modern applications face challenges such as:
- Diverse drivers and configurations for different databases.
- The need to learn SQL for direct queries.
- Security risks when exposing direct database connections.
- Integration complexity in microservice architectures.
RestDB4J addresses these issues by offering:
- A RESTful API for decentralized and flexible database access.
- A simplified HTTP interface eliminating the need for SQL.
- Process standardization through REST conventions.
- Improved security via controlled endpoints.
- Interoperability with any HTTP-compatible language or tool.
- Java: 21+
- Maven: 3.9.9+
- Docker: Required for running in a container.
- Clone the repository:
git clone https://github.com/DumiJDev/restdb4j.git
- Navigate to the project directory:
cd restdb4j
- Build the project:
mvn clean install package
- Navigate to the target directory:
cd target
- Run the application:
java -jar restdb4j.jar
Run the following command:
docker run --name restdb4j --rm -p 8082:8080 dumijdev/restdb4j:latest
RestDB4J currently supports:
- Select: ALIAS fields and table, WHERE, ORDER BY, JOIN, PAGINATION.
- Insert.
- Update.
- Delete.
- SQL:
>
, API:greater
- SQL:
<
, API:lesser
- SQL:
=
, API:equals
- SQL:
<>
, API:not_equals
- SQL:
>=
, API:greater_equals
- SQL:
<=
, API:lesser_equals
- SQL:
LIKE
, API:like
- SQL:
NOT
, API:not
- SQL:
IS NOT NULL
, API:not_null
- SQL:
IS NULL
, API:null
- SQL: LEFT, API:
left
- SQL: RIGHT, API:
right
- SQL: INNER, API:
inner
- SQL: OUTER, API:
outer
- SQL: FULL, API:
full
- SQL: UNKNOWN, API: ``
- MYSQL, API:
mysql
- POSTGRES, API:
postgres
- ORACLE, API:
oracle
- SQLITE, API:
sqlite
- H2, API:
h2
- UNKNOWN, API:
unknown
Configuration can be done using:
- application.yml: For local setup.
- Environment variables: Works seamlessly with Docker.
Name | Default | Description |
---|---|---|
RESTDB_NAME | RestDB4J | Name for application instance |
RESTDB_DB_PLATFORM | h2 | Database platform (API value, see Constants) |
RESTDB_DB_PORT | Database port | |
RESTDB_DB_USER | sa | Database user |
RESTDB_DB_PWD | password | Database password |
RESTDB_DB_NAME | restdb.db | Database name |
RESTDB_DRIVER_CLASS | Java Driver Class for Database | |
RESTDB_DB_URL | Database custom URL string connection | |
RESTDB_SERVER_NAME | restdb | Name for instance in URL |
RESTDB_DB_HOST | localhost | Database host |
Your contributions are vital! Follow the steps below to get started:
- Fork the repository: Create your own copy to work on.
- Create a branch: Name your branch descriptively, e.g.,
feature/new-feature
orfix/bug-fix
. - Open an issue: Describe your idea or the bug you plan to address.
- Implement your changes: Follow coding standards and include tests.
- Submit a Pull Request: Target the
staging
branch with a detailed description of your changes.
- Ensure code quality and proper documentation.
- Add tests for any new features or bug fixes.
- Follow the repository's coding standards.
This project is licensed under the MIT License.
© 2024 RestDB4J - Powered by DumiJDev