Skip to content

Instantly share code, notes, and snippets.

@sourabhv
Last active May 24, 2017 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourabhv/02d1554313aed0cae998a03379e8d9a1 to your computer and use it in GitHub Desktop.
Save sourabhv/02d1554313aed0cae998a03379e8d9a1 to your computer and use it in GitHub Desktop.
Repository Design Pattern in Android using RxJava, Retrofit, SQLBrite and SQLDelight
CREATE TABLE address (
id INTEGER NOT NULL,
name TEXT NOT NULL,
line1 TEXT NOT NULL,
line2 TEXT,
landmark TEXT,
city TEXT NOT NULL,
country TEXT NOT NULL,
pincode INTEGER NOT NULL,
PRIMARY KEY(id) ON CONFLICT REPLACE
);
insertRow:
INSERT INTO address(id, name, line1, line2, landmark, city, country, pincode)
VALUES (?, ?, ?, ?, ?, ?, ?, ?);
selectAll:
SELECT *
FROM address;
selectById:
SELECT *
FROM address
WHERE id=?;
deleteById:
DELETE FROM address
WHERE id=?;
deleteAll:
DELETE FROM address;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment