Skip to content

Commit

Permalink
added compound index support
Browse files Browse the repository at this point in the history
  • Loading branch information
anidotnet committed Jun 29, 2021
1 parent 9a463da commit 17b255c
Show file tree
Hide file tree
Showing 1,220 changed files with 72,338 additions and 66,521 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11' ]
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
Expand All @@ -26,11 +29,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v2.1.0
with:
distribution: 'zulu'
java-version: '8'
java-version: ${{ matrix.Java }}
java-package: jdk
architecture: x64

Expand All @@ -40,6 +43,21 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean build

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '8'
java-package: jdk
architecture: x64

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Prepare PGP Keys
if: github.ref == 'refs/heads/develop'
run: openssl aes-256-cbc -pass pass:$PGP_KEY_PASSWORD -in ./.ci/secring.gpg.enc -out $GITHUB_WORKSPACE/secring.gpg -d -md md5
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ after_success:

env:
global:
- NITRITE_VERSION=4.0.0-SNAPSHOT
- NITRITE_VERSION=4.0.1-SNAPSHOT
- PGP_KEY_FILE=~/secring.gpg
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Nitrite is an embedded database ideal for desktop, mobile or small web applicati
- Schema migration
- Indexing
- Full text search
- Rx-Java support
- Both way replication via Nitrite DataGate server
- Very fast, lightweight and fluent API
- Android compatibility (API Level 19)
Expand Down Expand Up @@ -249,13 +248,13 @@ try (Session session = db.createSession()) {

Migration migration1 = new Migration(Constants.INITIAL_SCHEMA_VERSION, 2) {
@Override
public void migrate(Instruction instruction) {
instruction.forDatabase()
public void migrate(Instruction instructions) {
instructions.forDatabase()
// make a non-secure db to secure db
.addPassword("test-user", "test-password");

// create instruction for existing repository
instruction.forRepository(OldClass.class, null)
// create instructions for existing repository
instructions.forRepository(OldClass.class, null)

// rename the repository (in case of entity name changes)
.renameRepository("migrated", null)
Expand Down Expand Up @@ -289,8 +288,8 @@ Migration migration1 = new Migration(Constants.INITIAL_SCHEMA_VERSION, 2) {

Migration migration2 = new Migration(2, 3) {
@Override
public void migrate(Instruction instruction) {
instruction.forCollection("test")
public void migrate(Instruction instructions) {
instructions.forCollection("test")
.addField("fullName", "Dummy Name");
}
};
Expand Down
7 changes: 7 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,11 @@ https://docs.yugabyte.com/latest/architecture/docdb/persistence/

https://blog.yugabyte.com/enhancing-rocksdb-for-speed-scale/

## Query Optimization
- https://www.javatpoint.com/dbms-transforming-relational-expressions
- http://www.cbcb.umd.edu/confcour/Spring2014/CMSC424/query_optimization.pdf
- https://www.tutorialcup.com/dbms/query-optimization.htm
- https://www.geeksforgeeks.org/query-optimization-in-relational-algebra/



2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ org.gradle.jvmargs=-Xmx1024m
org.gradle.parallel=false
#android.enableSeparateAnnotationProcessing=true
# artifact version
nitriteVersion=4.0.0-SNAPSHOT
nitriteVersion=4.0.1-SNAPSHOT
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
11 changes: 7 additions & 4 deletions nitrite-android-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:4.1.1'
}
}

Expand All @@ -46,17 +46,18 @@ android {
exclude 'META-INF/LGPL2.1'
}

compileSdkVersion 29
compileSdkVersion 28

defaultConfig {
applicationId "org.dizitart.no2.example.android"
minSdkVersion 19
targetSdkVersion 29
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// multiDexEnabled true

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -71,6 +72,7 @@ android {
}

compileOptions {
// coreLibraryDesugaringEnabled true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Expand All @@ -92,6 +94,7 @@ dependencies {
annotationProcessor "org.projectlombok:lombok:1.18.20"

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.9.0'
testAnnotationProcessor "org.projectlombok:lombok:1.18.20"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package org.dizitart.no2.example.android;

import org.dizitart.no2.collection.Document;
import org.dizitart.no2.mapper.Mappable;
import org.dizitart.no2.mapper.NitriteMapper;
import org.dizitart.no2.common.mapper.Mappable;
import org.dizitart.no2.common.mapper.NitriteMapper;

/**
* @author Anindya Chatterjee.
Expand Down
13 changes: 5 additions & 8 deletions nitrite-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ dependencies {
api project(":nitrite-spatial")
api project(":nitrite-replication")
api project(":nitrite-support")
api project(":rx-nitrite")
api project(":potassium-nitrite")

api project(":nitrite-mvstore-adapter")
api project(":nitrite-rocksdb-adapter")
api project(":nitrite-mapdb-adapter")

api "org.slf4j:slf4j-api:1.7.31"
api "org.objenesis:objenesis:2.6"
Expand All @@ -33,14 +31,13 @@ dependencies {
api "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.3"
api "org.mapdb:mapdb:3.0.8"
api "com.h2database:h2-mvstore:1.4.200"
api "com.squareup.okhttp3:okhttp:4.9.1"
api "com.squareup.okhttp3:okhttp:4.9.0"
api "org.rocksdb:rocksdbjni:6.20.3"
api "com.esotericsoftware.kryo:kryo5:5.1.1"
api "org.locationtech.jts:jts-core:1.18.1"
api "com.esotericsoftware:kryo:4.0.2"
api "org.locationtech.jts:jts-core:1.17.1"
api "commons-codec:commons-codec:1.15"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20"
api "org.jetbrains.kotlin:kotlin-reflect:1.5.20"
api "io.reactivex.rxjava2:rxjava:2.2.21"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10"
api "org.jetbrains.kotlin:kotlin-reflect:1.4.10"
}
}

Expand Down
2 changes: 1 addition & 1 deletion nitrite-jackson-mapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
testImplementation "org.locationtech.jts:jts-core:1.18.1"
testImplementation "org.awaitility:awaitility:4.1.0"
testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:2.14.1"
testAnnotationProcessor "org.apache.logging.log4j:log4j-core:2.14.1"
testImplementation "org.apache.logging.log4j:log4j-core:2.14.1"
testImplementation "com.github.javafaker:javafaker:1.0.2"
testImplementation platform("com.fasterxml.jackson:jackson-bom:2.12.3")
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper;
package org.dizitart.no2.common.mapper;

import com.fasterxml.jackson.databind.Module;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper;
package org.dizitart.no2.common.mapper;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.core.JsonParser;
Expand All @@ -29,7 +29,7 @@
import org.dizitart.no2.collection.Document;
import org.dizitart.no2.common.util.ObjectUtils;
import org.dizitart.no2.exceptions.ObjectMappingException;
import org.dizitart.no2.mapper.extensions.NitriteIdExtension;
import org.dizitart.no2.common.mapper.extensions.NitriteIdExtension;

import java.io.IOException;
import java.lang.reflect.Modifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper;
package org.dizitart.no2.common.mapper;

import org.dizitart.no2.module.NitriteModule;
import org.dizitart.no2.module.NitritePlugin;
import org.dizitart.no2.common.module.NitriteModule;
import org.dizitart.no2.common.module.NitritePlugin;

import java.util.Set;

import static org.dizitart.no2.common.util.Iterables.setOf;

/**
* @author Anindya Chatterjee
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper.extensions;
package org.dizitart.no2.common.mapper.extensions;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper.extensions;
package org.dizitart.no2.common.mapper.extensions;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.dizitart.no2.collection.NitriteId;
import org.dizitart.no2.mapper.JacksonExtension;
import org.dizitart.no2.common.mapper.JacksonExtension;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.dizitart.no2.mapper.extensions;
package org.dizitart.no2.common.mapper.extensions;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2017-2021 Nitrite author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.dizitart.no2.common.mapper;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class JacksonMapperModuleTest {

@Test
public void testPlugins() {
assertEquals(1, (new JacksonMapperModule()).plugins().size());
}
}

Loading

0 comments on commit 17b255c

Please sign in to comment.