Git Product home page Git Product logo

easiestsqllibrary's People

Contributors

cookieukw avatar p32929 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

easiestsqllibrary's Issues

Cleaned database when contacting the second table

 fun EasyDB(): EasiestDB {
            return EasiestDB.init(instance)
                    .addTableColumns("Objects",
                            Column("wmid", "integer", "unique"),
                            Column("title", "text"),
                            Column("descr", "text"),
                            Column("lat", "text"),
                            Column("lng", "text"),
                    ).addTableColumns("Chat",
                            Column("uid", "text"),
                            Column("name", "text"),
                            Column("text", "text"),
                            Column("time", "text"),
                            Column("msgid", "integer", "unique")
                    )
                    .doneAddingTables()
        }

So I create two tables, the first fill when the user is first and do not touch anymore. Chat fill when checking new messages. And once, he cleans me the first table.

App.Companion.EasyDB().addDataInTable(1,
                                    new Datum("uid", uid),
                                    new Datum("name", name),
                                    new Datum("text", text),
                                    new Datum("time", time),
                                    new Datum("msgid", msgid));

This is a chat filling method.

A possible mistake

I use a recyclerView and add items to it. So far so good (it's a chat), I happen to add this item to sqlite using the library, if I want to remove this item (which in this case would be a message) I can't because I don't have the id of this item (in sqlite ). Now if I exit the app and return, I already have the ids because in the method of getting all the items, I also have all the ids. I think there could be a way to send the item to sqlite and get the id of that item, I don't know if it's possible. As I can't modify the libs (I only have android) so I can only report these bugs instead of forking and fixing

Update function is not working.

All functions are working well except update function.

I added one record.

easiestDB.addDataInTable(0,
new Datum(1, "FirstName"),
new Datum(2, "LastName")
);

and tried to update with this code.

            easiestDB.updateData(0, 1,
                    new Datum(1, "aaa"),
                    new Datum(2, "bbb"));

I got this error code below.

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.ContentValues.put(java.lang.String, java.lang.String)' on a null object reference
at org.richit.easiestsqllib.EasiestDB.updateData(EasiestDB.java:74)

request

thank for this library..
please add a code about

-reading db from local folder / assets
-location where we can find the db.
-how to save the entire database to local folder

thank you

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

I have Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
on

        EasiestDB easiestDB = EasiestDB.init(this);
        Cursor cursor = easiestDB.getOneRowData(0, 0);
        if (cursor != null) {
            SQlite SQlite = new SQlite();
            SQlite.execute();
        }

How i can check if DB is null and insert data?

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.