Tutorial by Examples: ase

You might want to import and export your database for bacukups for example. Dont forget about the permissions. public void exportDatabase(){ try { File sd = Environment.getExternalStorageDirectory(); File data = Environment.getDataDirectory(); String currentD...
We can create it by two way. First from database properties designer mode: And by sql scripts: USE master; GO -- Create the database with the default data -- filegroup and a log file. Specify the -- growth increment and the max size for the -- primary data file. CREATE DATABASE TestDB ON...
You must create your own database, and not use write to any of the existing databases. This is likely to be one of the very first things to do after getting connected the first time. CREATE DATABASE my_db; USE my_db; CREATE TABLE some_table; INSERT INTO some_table ...; You can reference your...
The following databases exist for MySQL's use. You may read (SELECT) them, but you must not write (INSERT/UPDATE/DELETE) the tables in them. (There are a few exceptions.) mysql -- repository for GRANT info and some other things. information_schema -- The tables here are 'virtual' in the sense ...
First Initialize FirebaseDatabase: FirebaseDatabase database = FirebaseDatabase.getInstance(); Write to your database: // Write a message to the database FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("message"); myRef....
app.ts import {Component} from '@angular/core'; import {Platform, ionicBootstrap} from 'ionic-angular'; import {StatusBar} from 'ionic-native'; import {LoginPage} from './pages/login/login'; import {FIREBASE_PROVIDERS, defaultFirebase, AuthMethods, AuthProviders, firebaseAuthConfig} from 'angul...
There is no single command to rename a MySQL database but a simple workaround can be used to achieve this by backing up and restoring: mysqladmin -uroot -p<password> create <new name> mysqldump -uroot -p<password> --routines <old name> | mysql -uroot -pmypassword <new na...
The following commands can be used to swap the names of two MySQL databases (<db1> and <db2>): mysqladmin -uroot -p<password> create swaptemp mysqldump -uroot -p<password> --routines <db1> | mysql -uroot -p<password> swaptemp mysqladmin -uroot -p<password&gt...
Implementation of IDatabaseInitializer that is used in EntityFramework by default. As the name implies, it creates the database if none exists. However when you change the model, it throws an exception. Usage: public class MyContext : DbContext { public MyContext() { Database.SetIni...
This implementation of IDatabaseInitializer drops and recreates the database if the model changes automatically. Usage: public class MyContext : DbContext { public MyContext() { Database.SetInitializer(new DropCreateDatabaseIfModelChanges<MyContext>()); } }
This implementation of IDatabaseInitializer drops and recreates the database everytime your context is used in applications app domain. Beware of the data loss due to the fact, that the database is recreated. Usage: public class MyContext : DbContext { public MyContext() { Database.S...
You can create your own implementation of IDatabaseInitializer. Example implementation of an initializer, that will migrate the database to 0 and then migrate all the way to the newest migration (usefull e.g. when running integration tests). In order to do that you would need a DbMigrationsConfigur...
An implementation of IDatabaseInitializer that will use Code First Migrations to update the database to the latest version. To use this initializer you have to use DbMigrationsConfiguration type too. Usage: public class MyContext : DbContext { public MyContext() { Database.SetInitial...
context.globalCompositeOperation = "destination-out" "destination-out" compositing uses new shapes to erase existing drawings. The new shape is not actually drawn -- it is just used as a "cookie-cutter" to erase existing pixels. context.drawImage(apple,0,0); conte...
Increase the saturation level of an image with ctx.globalCompositeOperation = 'saturation'; The amount of the effect can be controled with the alpha setting or the amount of saturation in the fill overlay // Render the image ctx.globalCompositeOperation='source-atop'; ctx.drawImage(image, 0, ...
PrepareForSegue: func prepareForSegue(_ segue:UIStoryboardSegue, sender sender:AnyObject?) Notifies the view controller that a segue is about to be performed Parameters segue: The segue object. sender: The object that initialized the segue. Example in Swift Perform a task if the ident...
If the administrator creates your database for you when setting up your permissions, you can begin using it. Otherwise, you need to create it yourself: mysql> CREATE DATABASE menagerie; Under Unix, database names are case sensitive (unlike SQL keywords), so you must always refer to your datab...
A model for a new table can be created by running the following commend from the terminal root location: phalcon model <table-name> Let us take the Model Users. SELECT There are two default functions to do select operation in phalcon, find() and findFirst() findFirst() is used to get th...
By default stored procedures and functions or not generated by mysqldump, you will need to add the parameter --routines (or -R): mysqldump -u username -p -R db_name > dump.sql When using --routines the creation and change time stamps are not maintained, instead you should dump and reload the ...
PhraseQuery is used to search for a sequence of terms. The following matches the phrase "Hello World" (after being indexed with StandardAnalyzer) Query query = new PhraseQuery.Builder() .add(new Term("text", "hello")) .add(new Term("text"...

Page 21 of 40