tata88k/sqlite-generator-android


This is a powerful sqlite code generator for android .

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.thepacific:sqlite-generator-android:'
	}
	dependencies {
		implementation("com.github.thepacific:sqlite-generator-android:")
	}
	<dependency>
	    <groupId>com.github.thepacific</groupId>
	    <artifactId>sqlite-generator-android</artifactId>
	    <version></version>
	</dependency>

                            
    libraryDependencies += "com.github.thepacific" % "sqlite-generator-android" % ""
        
        

                            
    :dependencies [[com.github.thepacific/sqlite-generator-android ""]]
        
        

Readme


SQLite Generator

A powerful sqlite code generator from sqlite database file for android .中文教程

Introduce

This repository is a code genarator for Android . By using it, you can generate java codes to read/write sqlite

  • This is a standard java application.
  • Dev Language: Java
  • Dev IDE: IntelliJ_v15.0.2

Features

  • Generate map objects(tables and data views) from an existing sqlite file
  • Generate API to read/write sqlite (insert,update,delete,query and so on)
  • API based on SQLiteOpenHelper and 100% support any SQL statement
  • API is super light , expandable and pluggable
  • Code quantity is less 60% than GreedDao

Usage

  • Clone the whole project from github
  • Import the project into IntelliJ (Optionally, you can copy the sources to eclipse IDE)
  • Set your own models package, api package ,table name format,and the target directory
  • Run the project, and you will see the whole generated codes in the target directory

PS: I design my sqlite database file on SQLiteStudio and generate code with this Generator

API

Limit

  • Currently , you must set a named "id" column as the table primary key. For more needs, modify the source by yourself.
  • You must name your tables or views in a strict format . Currently, Pascal ,Hungarian and Camel format are supported.

Dependencies

  • freemarker-2.3.23.jar
  • sqlite-jdbc-3.8.11.2.jar