Questions tagged [database]

80125 questions
1

votes
2

answer
533

Views

Can't be upload an image in Firebase Storage in android

I'm learning to upload the an image in Firebase Storage but when i run / open my app and select an image to upload there is no any image to upload in firebase storage please help me where i mistake to write code . Androidmanifest.xml: MainActivity.java: package com.fireapp.newfireapplication; import...
LearnToProgram
1

votes
3

answer
4.3k

Views

how to fetch firebase data?

I am new to python and firebase and I am trying to flaten my firebase database. I have a database in this format each cat has thousands of data in it. All I want is to fetch the cat names and put them in an array. for example I want the output to be ['cat1','cat2'....] I was using this tutorial ht...
learner101
1

votes
1

answer
238

Views

Partitioning table based on first letter of a varchar field

I have a massive table (over 1B records) that have a specific requirement for table partitioning: (1) Is it possible to partition a table in Postgres based on the first character of a varchar field? For example: For the following 3 records: a-blah a-blah2 b-blah a-blah and a-blah2 would go in the 'A...
Winker
1

votes
0

answer
97

Views

Store image in sqlite from variable

I created this database public void onCreate(SQLiteDatabase db) { String query='CREATE TABLE '+tableName+' ( ID INTEGER PRIMARY KEY AUTOINCREMENT, ' + col1+' INTEGER, '+col2+' String, '+col3+' String, '+col4+' String );'; db.execSQL(query); } to sotre an image with some informations in a list I get...
Hossame Makhlof
1

votes
1

answer
144

Views

How can I switch firebase configuration using toggle in react native

I am using reactnative, redux and firebase. Now i want to config two diff firebase env one is development and other one is production. I implemented a toggle to switch the firebase diff account. i put firebase config file in ./App.js import React, { Component } from 'react'; import { Provider } from...
Subrata Mallik
1

votes
1

answer
312

Views

Tracking if a User 'likes' a post

This is more of a theoretical how database should be setup, and less about programming. Lets say I have a news feed full of cards, which each contain a message and a like count. Each user is able to like a mesesage. I want it to be displayed to a user if they have already liked that particular card....
jdoej
1

votes
0

answer
332

Views

firebase value event listener nested inside another listener fetching data and get user by id

I'am trying to get post's comments from firebase database and each comment got a userId which is the publisher, Comment and User are 2 nodes completely separated, Comment contains the postId : comments -> postId -> commentId -> {comment : 'bla bla', date : 1514209400.62254, userId:'sd5f34sdf3az564e...
majd jlassi
1

votes
2

answer
545

Views

MySQLdb doesn't work with utf8mb4

The commands Import MySQLdb MySQLdb.connect(user='root', passwd='1234', charset='utf8mb4') Work on Linux. But on Windows it throws the following exception: Operational Error (2019, can't initialize character set utf8mb4 (path: c:\\mysql\\\\share\\charsets\\) ') That path doesn't even exist on my com...
jackLantern
1

votes
0

answer
80

Views

Swift - Upload/Retrieve images to/from Firebase

I want my users to be able to set their profile pictures in my application. I am holding the profile datas which contains the user's profile picture as a table view cell. However, I had problems in my code. This is my table view function: func tableView(_ tableView: UITableView, cellForRowAt indexPa...
atunaysaka
1

votes
1

answer
109

Views

CodeIgniter - Update Database Record

I've done the coding of Update Database record in Codeigniter. Everything works fine but When I click the Save button database records won't update. Each time it's showing the old database records. I want to update the database records but what's wrong with this. I don't understand the missing thing...
Mehreen
1

votes
0

answer
385

Views

Java: how to execute stored procedure from other schema

Executing the procedure, isb.pkg_po_test.get_component, I have to get a cursor from remote database. Our schema is ISBREPORTER and we have limited access to the schema ibs. However, on Oracle SQL Plus the following is executed very well: SQL> var r refcursor SQL> exec isb.pkg_po_test.get_component(1...
valijon
1

votes
1

answer
373

Views

Unity freezes at firebase GetAsyncValue().ContinueWith()

I have the latest firebase unity SDK - 4.3.0 My Unity version is 2017.2.0f3 In my script, if I have two calls to GetValueAsync().ContinueWith(), the first one is executed normally and the second one halts. If I somehow merge the two calls into one, the program halts at the first call. I have already...
CCS
1

votes
0

answer
21

Views

Migrate sharded mongo cluster from one cloud service to another

We are migrating mongodb (shared cluster architecture) from a cloud service to another. Let's call C1 (source) and C2 (dest). All of mongodb and mongos instances are bind with private ip (not using domain as expected) in C1. i stoped all instances of C1, copied to C2 successfully. But the new cluste...
William
1

votes
0

answer
397

Views

How to check if user exist in Firebase real time database

I am using Firebase real time database, and I want to have something like this, Location //Reference name ------->uid //user id I will use the user uid from my SQL database not firbase push() ------->latitudeLocation ------->longitudeLocation I use this for now to update the latitude and longitude...
Lim Cho
1

votes
1

answer
291

Views

Display all posts from multiple firebase directories into recyclerView

I'm working on our thesis about classroom announcements and I got stuck into this. In my database, I have decided to put posts of different users under several categories. Categories Categories displaying posts So I have successfully displayed all the posts under one category (Class Announcements) o...
daveduya011
1

votes
1

answer
47

Views

Modeling database to support complex company-product-price relationship

In software that we are building we have a parent-child relationship between companies (one company can only have one parent company but can have multiple child companies) and we need to adjust our product pricing for every company. Here is a quick db model of how it should look like but this Compan...
kljuco
1

votes
1

answer
38

Views

Django tags/keywords based search [closed]

I'm learning Django to build a website with a search engine. I only found documentation for full text search. However, I'm trying to implement a keywords/tags based search that I add to each item. For example, if a user searches meat, all meat products like chicken, beef, ham, will pop up. Items ca...
Bassam Mohmaud
1

votes
0

answer
87

Views

How to migrate only category data in data-migration-tool from Magento1.8 to Magento2.2?

I want to migrate only category data from magento1 database to magento2 database. Is there any code for category in config.xml file of data-migration-tool?
Dhaduk Mitesh
1

votes
0

answer
194

Views

How to retrieve all children from Firebase Database

I'm trying to learn how to use Firebase by creating a simple social media application. https://i.stack.imgur.com/wfeyw.png (Here is how my database is laid out) I was able to add data to the database but I'm having trouble understanding how to retrieve data. I want to be able to retrieve all the pos...
KevinDunbar
1

votes
1

answer
40

Views

creating a trigger in php-my-admin

i would like to create a trigger using the phpmyadmin 'add trigger' option. The Trigger should run AFTER every INSERT in table comments that takes the highest 'number of comments' (nc in DB) from the table 'POST' and takes the 'ID' and the 'question' of that row and puts it in the 'top_questions' t...
Zyzzx
1

votes
0

answer
19

Views

flask mysqldb call a related table

Flask-mysqldb Is there a way to call the related table without making a new query? if it's stored within the teacher object or something. So I have the id under 'teacher' and they have a relation in MySQL. {% for class1 in classes %} {{class1.name}} {{class1.code}} {{class1.teacher}} Outputs: 'Class...
Jordy
1

votes
0

answer
76

Views

Which database schema should i use?

I am building a Rest Api using node, MySQL and MongoDB, but i am confused with the database schema to go for as the business case is B2B and for each business(customer) there is like 10 tables for general ledger, products, transactions, clients, sales, purchase and many like these. and for accommoda...
Suraj Malviya
1

votes
0

answer
359

Views

How can I use ORM database “Active Android” by Kotlin on Android Studio?

I try to use Active Android (ORM DataBase) in My Kotlin Project But when I save the EditText input , my program always crashes! All program codes are available in Gitlab.com Where is the problem with my codes? and if you know the sources of education in this regard, tell me to come MainActivity.kt ....
Majid ahmadi
1

votes
3

answer
63

Views

Add columns of old purchases per customer to compare them

Reading a book on Sqlite and decided to test certain queries for fun. This one got me thinking. How would you return the number of the continuous buyers who got a new item with a lower price than their previous item? no joins required its all in the same table. relevant table names: day: date bought...
J_p
1

votes
0

answer
39

Views

How to get data synchonously in Firebase?

I have a function isDeploymentAdminAvailable(deployment){ let customQuery = { equalTo: this.selectedDeploy.key } this.authService.fnGetDataUsingCustomQuery(FirebaseDb.firebasedeploymentAdminTable, customQuery).subscribe( (rec: any) => { rec.forEach((reccord: any) => { reccord.key = reccord.$key; });...
NeoCoder
1

votes
3

answer
503

Views

How to build connection string from existing connection for new database created dynamically?

I have query to dynamically create database. private void ExecuteNonQuery(string sql) { using (var connection = new SqlConnection(_connectionString)) { connection.Open(); SqlCommand command = connection.CreateCommand(); command.CommandText = sql; command.ExecuteNonQuery(); } } private void CreateDat...
Sachin
1

votes
0

answer
318

Views

Firebase setPersistenceEnabled vs keepSynced

I've read about the differences, however I am still confused. I have an app where the user can swipe to decrease a number, and as soon as that number is decreased, a timer may start. This timer runs in the background, so that if the user comes back, it will resume at its corresponding time. As soon...
Gerald Tan
1

votes
0

answer
94

Views

how to send current location to specific people in firebase database

i want to send current location to specific people in my firebase database when a button is clicked. These people change from device to device depending on which people the user has selected to get notification about the sender's location. I have a clue on what's required of me to do but i can't see...
Malusi Gcabashe
0

votes
5

answer
28

Views

Extracting .txt data into a meaningful table for analysis using Python (or R)

I'm working on an engineering project in which I'm using machine performance data from archives. The machine produces one data set approximately every 5s and this data is then available date-wise in a number of .txt files with each file containing data in the following format. The data shown below...
kd68
0

votes
0

answer
3

Views

Is there a shorter workaround to reduce the number of AsyncTask in my Room DataBase Repository

I am trying to simplify the number of lines for my codes in the repository. Currently there is a lot of repetition in my codes. Many of the solutions online only involves inserting once into the table. I need to do insert() on many tables. I want to reduce the repetition for writing the same inner A...
Peter
1

votes
0

answer
69

Views

Mysql: Negative balance query

I have a table called customer_wallet with id as primary key, balance(contains both -ve & +ve values), date(transaction date). Now some customers have privilege that they can do transactions in even if they have no balance. We get total Balance of a customer by doing (SUM(balance) where customer_id=...
Anubhav Gupta
1

votes
0

answer
60

Views

Django Model Design (Big model vs multiple)

I have a question about designing my models. Suppose I have a following model: class Comment(models.Model): who = models.ForeignKey(User, on_delete=models.CASCADE) created = models.DateTimeField(auto_now_add=True) text = models.CharField(max_length=1000) likes = models.IntegerField(default=0) parent...
Meemaw
1

votes
0

answer
299

Views

How do you make a storage reference in swift for Firestore

How do you create a field of type storage reference in the swift dictionary format using swift. I keep on getting an error saying that FIRStorageReference. This is the code below, photoRef is a storage reference: let newFirePhotoRef = newUserRef.collection('Photos').document() photoRef = photoRef.ch...
user372382
1

votes
0

answer
84

Views

Restore .sql.xz file to postgresql database in docker

First, I follow the postgresql instruction on docker: docker run --name test-postgres then i tried to restore my db by the following command: xz -dc matrix-ww.sql.xz | docker exec -i test-postgres psql -U postgres matrix --set ON_ERROR_STOP=on --single-transaction the command seems executed. however...
Rizary
1

votes
1

answer
101

Views

Firebase save query.addValueEventListener data globally

I want to save the data I retrieved from the query to global class variables e.g .RoomType but when it exists query.addValueEventListener's scope the data is never saved. When I perform Log.w('Value', ' value is '+ RoomType ); within its scope it outputs the data retrieved. How would I save those da...
nick122122
1

votes
2

answer
412

Views

How to fetch only updated object from Relatime Firebase Database?

I am new to Firebase Real-time Database and don't have an idea that how to fetch only the recent updated object from the table. I have tried using 'ChildEventListener' but when I initialize the Listener for the first time it fetches the last row from the database. It should not be fetched if it was...
Mehul_MG
1

votes
4

answer
97

Views

Mysql fetch from last to first - [many records]

i want to fetch records from mysql starting from last to first LIMIT 20. my database have over 1M records. I am aware of order by. but from my understanding when using order by its taking forever to load 20 records i have no freaking idea. but i think mysql fetch all the records before ordering. SE...
Marvin Collins
1

votes
0

answer
310

Views

MongoDB - Problems with database design and statistical data calculation

I am currently facing a problem with MongoDB and that's probably due to my schema design, but I am unsure how to go about it. So basically I have this collection (mongoose Schema): const PlayerStatsCollection = { sportType: MongoId, player: MongoId, match: MongoId, team: MongoId, date: Date, league:...
Morphex
1

votes
0

answer
229

Views

Create view from multiple database

I learned about using db.siblingsDB and db.sisterDB. But I can't use both in creating a view from different databases. My example query I tried are: use 'database1' var users = db.getSiblingDB('database2').getCollection('User').find({}) db.runCommand({ 'create' : 'VW_User', 'viewOn' : users, 'pipeli...
trying...
1

votes
1

answer
60

Views

I have issues fetching user data from Firebase and showing it in a TextView/EditText

Fragment's Oncreate public class HomeScreen_Profile extends Fragment { EditText Name, Email, Status, Quote; private FirebaseAuth mAuth; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_pro...

View additional questions