1/* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import rdb from '@ohos.data.relationalStore' 17 18// table name 19export const TABLE_NAME: string = 'contact' 20 21// table config 22export const STORE_CONFIG: rdb.StoreConfig = { name: 'contact.db', securityLevel: rdb.SecurityLevel.S1 } 23 24// create table sql 25export const SQL_CREATE_TABLE: string = 'CREATE TABLE IF NOT EXISTS contact (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, phone TEXT NOT NULL, email TEXT NOT NULL, address TEXT NOT NULL, remark TEXT NOT NULL, UNIQUE(name))' 26 27export const BASE_URI = 'datashare:///ohos.samples.dataprovider.DataShare' 28 29export const COLUMNS = ['*'] 30 31export const OPERATE_STATUS = { 32 ADD: 'ADD', 33 UPDATE: 'UPDATE' 34} 35 36export const SYNC_STATE = { 37 OVERWRITE_CONTACT_ASSISTANT: 'overwrite contact assistant', 38 OVERWRITE_CONTACT: 'overwrite contact', 39 DEDUPLICATION: 'deduplication' 40}