Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

postgrest-java

Current version: Memo

example:

//rest URLStringurl = "";
// public keyStringpubKey = "";
//Example map to preload request header with payload like apikeyMap<String, String> headers = newHashMap<>(Map.of("apikey", pubKey ));
Stringschema = "api";
PostgrestClientclient = newPostgrestClient(
url, headers, schema
);
PostgrestQueryBuildercontactQB = client.from("contacts");
// SELECT id, name FROM contacts;PostgrestFilterBuildercontactsFilter = contactQB.select("id, name");
// Contact is just a POJO classContact[] contactsName = contactsFilter.get(Contact[].class);
System.out.println(Arrays.toString(contactsName));
// SELECT * FROM contacts;PostgrestFilterBuilderallContactsFilter = contactQB.select();
Contact[] allContacts = allContactsFilter.get(Contact[].class);
System.out.println(Arrays.toString(allContacts));
contactQB.insert(newArrayList(newHashMap<>(
Map.of("col", "val", "col2", "val2", ...)
))).get(...)
//Always call get method to fetch the api

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages