android, how to exec a sql file in sqlitedatabase

i have “food_db.sql” file stored in /res/raw folder, it has tons of ‘insert’ in it. my question is how to i exec the file and get the data into sqlite databse in my android app? here is the database code of mine. any sugguestions? private static class DbHelper extends SQLiteOpenHelper{ public DbHelper(Context context) { super(context, … Read more

Propel: Get Raw SQL from Query object?

How do I get the raw SQL statement from a query object in Propel? I need this for debugging purposes. For example: I would like to have a function as in $rawSql = new BookQuery::create()->filterById(25)->getRawSql(); Does something like this exist? Answer Yes; you’re after the toString method from the Criteria parent class: $rawSql = (new … Read more

Symfony2 execute SQL file in Doctrine Fixtures Load

I’m migrating an old web app based on SQL Server and ASP to Symfony2 and MySQL. I made some queries and export old data to individual SQL files. How can I execute thoses files in my fixtures, when I run the command $php app/console doctrine:fixtures:load Now I have some fixtures that works directly with Doctrine … Read more

Does AWS RDS encryption with KMS affect performance?

Amazon states that Encryption and decryption are handled transparently so you don’t have to modify your application to access your data My application (Rails, MySQL, Elasticsearch) builds a lot of graphics and therefore queries a lot of data. From my prior experience with database encryption, it really affects data retrieving speed (as we can only … Read more

Handle same function running and processing the same data at the same time

I have a php system that that allow customer to buy things (make an order) from our system using e-wallet (store credit). here’s the database example **sales_order** +——–+——-+———-+——–+————–+———–+ |order_id| price |product_id| status |already_refund|customer_id| +——–+——-+———-+——–+————–+———–+ | 1 | 1000 | 1 |canceled| 1 | 2 | | 2 | 2000 | 2 |pending | 0 | … Read more

Multiple aggregate functions in one SQL query from the same table using different conditions

I’m working on creating a SQL query that will pull records from a table based on the value of two aggregate functions. These aggregate functions are pulling data from the same table, but with different filter conditions. The problem that I run into is that the results of the SUMs are much larger than if … Read more