Skip to content

mtexplorative/dbml-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBML Parser for the JVM

Database Markup Language (DBML), designed to define and document database structures. See the original repository.

Using Java 17.

Example usage:

import com.wn.dbml.compiler.lexer.LexerImpl;
import com.wn.dbml.compiler.parser.ParserImpl;
import com.wn.dbml.model.Database;

class Example {
  public static void main(String[] args) {
    var dbml = """
        Table table1 {
          id integer
        }""";
    // parse the dbml
    Database database = new ParserImpl().parse(new LexerImpl(dbml));
    // process the database structure
    database.getSchemas().stream()
        .flatMap(schema -> schema.getTables().stream())
        .forEach(System.out::println); // prints "table1"
  }
}

Maven dependency:

<dependency>
    <groupId>io.github.nilswende</groupId>
    <artifactId>dbml-java</artifactId>
    <version>1.0.0</version>
</dependency>

About

DBML Parser for the JVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%