Git Product home page Git Product logo

gstorm's Introduction

gstorm's People

Contributors

dependabot-preview[bot] avatar github-actions[bot] avatar kdabir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gstorm's Issues

Groovy as compile-only dependency

We need to try this out, so that different groovy version is not downloaded because of transitive dependencies. Gstorm is not used in Java projects, so it is assumed some version of groovy is already available in the project / script in which gstorm is included.

Connection properties file

Will be awesome if new Gstorm() can detect if a file with database connetion properties in the classpath and use it. For example gstorm.properties with something like:

database=myDatabase
user=myUser
password=myPassword
....

Legacy tables

Hi, is there any way to stormify an object but not create a new table? Would be helpful with legacy databases.

Conditionally create table

Currently on intialization of gstorm, a create table query is executed with not exists clause (CREATE TABLE IF NOT EXISTS...). It's better to give user an option to exclude creation of table.

Try Groovy AST transformations

Try compile time meta-programming instead of runtime meta-programming. Key benefit includes IDE support and compilation failures instead of runtime failures.

Support for CSV files

So that csv files can be directly opened with gstorm and sql queries can be performed.

Indexed fields

It would be nice to have capability to be able to create indexed fields for better performance.
class Person { @Indexed String name }

Better place for documentation

Either github-pages (maybe using jekyll, or homegrown solution) or Wiki. Only considering markdown as the format in which docs will be written.

It would be great to have doc as part of main source repository, so not github considering wiki for now.

With jekyll md files can be converted to html by github, but need lot of steup and jekyll is more blog oriented than user manual.

Homegrown solution, generated html will also needed to be checked in to gh-pages.

Bad <init> method call from inside of a branch

After upgrading groovy version, running tests gives this error occurs :

Execution failed for task ':compileTestGroovy'.
> Bad <init> method call from inside of a branch
  Exception Details:
    Location:
      gstorm/Gstorm.<init>(Ljava/sql/Connection;)V @91: invokespecial
    Reason:
      Error exists in the bytecode
    Bytecode:
      0x0000000: b800 1a4d 04bd 0004 5903 2c12 5632 122b
      0x0000010: 2bb9 0059 0300 5359 10ff 1202 b800 292a
      0x0000020: 5fab 0000 0000 0071 0000 0004 8065 35b8
      0x0000030: 0000 002b aad3 b1ff 0000 0040 e83e bc00
      0x0000040: 0000 0053 0000 9b75 0000 0068 5f5a 5903
      0x0000050: 3212 2bb8 002f c000 2b5f 57b7 0032 a700
      0x0000060: 3e5f 5a59 0332 b800 38c0 003a 5f57 b700
      0x0000070: 3da7 002b 5f5a 5903 3212 3fb8 002f c000
      0x0000080: 3f5f 57b7 0042 a700 165f 5a57 b700 44a7
      0x0000090: 000d bb00 4659 1248 b700 49bf 57b1
    Stackmap Table:
      full_frame(@76,{UninitializedThis,Object[#63],Object[#77]},{Object[#79],UninitializedThis})
      full_frame(@97,{UninitializedThis,Object[#63],Object[#77]},{Object[#79],UninitializedThis})
      full_frame(@116,{UninitializedThis,Object[#63],Object[#77]},{Object[#79],UninitializedThis})
      full_frame(@137,{UninitializedThis,Object[#63],Object[#77]},{Object[#79],UninitializedThis})
      full_frame(@146,{UninitializedThis,Object[#63],Object[#77]},{Object[#79],UninitializedThis})
      full_frame(@156,{Object[#2],Object[#63],Object[#77]},{Object[#79]})

Happens with groovy 2.3.4+ on JDK 1.8 u11/20. Works on Groovy 2.3.2. So can not bump groovy until this is fixed. Found related issues in both groovy and JDK:

Create annotation for model classes

Will be awesome if you can annotate a model class, and gstorm do all job:

@GstormTable
class Person { 
  String name, project 
}

So, no need of:

def g = new Gstorm()
g.stormify(Person)   

Upgrade Versions

Upgrade versions of dependencies to latest

  • Gradle
  • Gradle Wrapper
  • Travis Java versions (build matrix)
  • Groovy
  • Gradle plugins
  • HSQLDB

Support SQLite DB

Can considering adding SQLite DB as it is very commonly used file based db.

Support for existing ID field

In existing tables, where ID field can have different name, add capability to configure name of the field (and perhaps the type)

Support JDK/JRE 11

Currently one test is failing on jre11, possibly because of a Groovy Bug : https://issues.apache.org/jira/browse/GROOVY-8871

gstorm.GstormDataTypesTest > initializationError FAILED
java.lang.IllegalAccessError at GstormDataTypesTest.groovy:-1
73 tests completed, 1 failed

Try to update to groovy 2.5.4 once released to see if that fixes the issue.

Include in jcenter

In groovy scripts, in grape jcenter is included by default, so user won't have to include a custom repo. in Gradle build, jcenter() repo is also easily configurable.

This would need a change in groupId, something like io.github.kdabir.gstorm.

Easier Creation of Gstorm instance

There is lot of boilerplate code that goes in the beginning of the script to gstormify a model class. Few step to reduce can be to add constructors that automatically use in memory / file db / connection etc.

Also can include hsqldb with gstorm to addition grab is gone. Just be careful with (systemClassLoader = true) stuff.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.