Skip to content

hstrada/datase-dsl-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building SQL DSL

Just building a custom SQL dsl for fun.

Focus and persistence.

Configure and install

<dependency>
  <groupId>io.delta</groupId>
  <artifactId>datase</artifactId>
  <version>0.1.4</version>
</dependency>

🎯 Requirements

  • IntelliJ IDEA or any editor/IDE
  • Java 11+
  • Kotlin

💻 Usage

select

fun main() {
    println(
        query {
            select("id", "name")
            from("users")
            where {
                "id" eq 1
            }
        }
    )
}

create

fun main() {
    println(
        create("Users") {
            with {
                "Id" to "int not null identity"
                "Name" to "varchar(255) null"
            }
        }
    )
}

update

fun main() {
    println(
        update("Users") {
            "name" eq "Helena"
            where {
                "id" id 1
            }
        }
    )
}

delete

fun main() {
    println(
        delete("Users") {
            "id" eq 1
        }
    )
}

About

[datase.vercel.app] Just creating a simple dsl sql for fun.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages