Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fixed demo application and the documentation of some elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaos66 committed Oct 3, 2016
1 parent 76c19c2 commit 50cbc7e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 19 deletions.
7 changes: 6 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>

<link rel="import" href="../kc-websql.html">
<link rel="import" href="../kc-websql-select.html">
<link rel="import" href="../kc-websql-insert.html">
<link rel="import" href="../kc-websql-delete.html">
<link rel="import" href="../kc-websql-update.html">
<link rel="import" href="../kc-websql-unsupported.html">
<link rel="import" href="../../paper-input/paper-input.html">
<link rel="import" href="../../paper-button/paper-button.html">
<link rel="stylesheet" href="../../paper-styles/paper-styles.html">
Expand Down Expand Up @@ -110,7 +115,7 @@ <h2> Ooops... </h2>

<kc-websql-delete from="texts" where="nr=?" on-finished="sqlFinished"></kc-websql-delete>

<array-composer length="2" array="{{updateArgs}}" f0="[[ts]]" f1="[[updateNr]]" update-on="updateNr"></array-composer>
<array-composer length="2" array="{{updateArgs}}" f0="[[ts]]" f1="[[updateNr]]" update-on="f1"></array-composer>
<kc-websql-update table="texts" fields="ts=?" where="nr=?" params="[[updateArgs]]" on-finished="sqlFinished"></kc-websql-update>

</kc-websql>
Expand Down
4 changes: 3 additions & 1 deletion kc-websql-delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="import" href="kc-websql.html">

<!--
This element helps deleting things from a Web Sql database.
This element helps deleting things from a `Web Sql` database.
You may either set `from` and `where` or for more complex cases: `sql`.
Expand Down Expand Up @@ -71,6 +71,8 @@

/**
* Parameters passed to the DELETE statement.
* Use the questionmark (?) placeholder within your sql statements for parametrized statements.
* These will be filled with the values from the `params` array.
*/
params: {
value: [],
Expand Down
4 changes: 2 additions & 2 deletions kc-websql-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
is: 'kc-websql-index',
properties: {
/**
* Name of the index
* Name of the index.
* Must be unique within the database!
*/
name: String,

/**
* Defines a unique index
* Defines a unique index.
* This constraint will throw an error when ever the index would become unique no more.
*/
unique: Boolean
Expand Down
9 changes: 6 additions & 3 deletions kc-websql-insert.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<link rel="import" href="kc-websql.html">

<!--
This element makes inserts into a Web Sql table easy.
This element makes inserts into a `Web Sql` table easy.
Simply set the `fields`, `into` and `params` attributes.
Or for more complex cases, use the `sql` attribute to define your own INSER statement.
Or for more complex cases, use the `sql` attribute to define your own INSERT statement.
Example:
Expand Down Expand Up @@ -72,6 +72,9 @@

/**
* Parameters passed to the INSERT statement.
* Use the questionmark (?) placeholder within your sql statements for parametrized statements.
* These will be filled with the values from the `params` array.
* If the `fields` property is used, the `params` will be inserted in the same order as the `fields`.
*/
params: {
value: [],
Expand Down Expand Up @@ -111,7 +114,7 @@
],

/**
* Runs the INSERT statement
* Runs the INSERT statement.
* You may pass `args`. This will cause the `params` property to be ignored
* and `args` will be used as parameter list.
*/
Expand Down
6 changes: 4 additions & 2 deletions kc-websql-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<!--
This element is used to select data from a Web SQL database.
This element is used to select data from a `Web SQL` database.
It serves as data-provider and can be bound to other elements via data-binding or events.
Expand Down Expand Up @@ -56,7 +56,7 @@
},

/**
* Defines the results field list.
* Defines the result field list.
* Only used to create a SELECT statement, when the `sql` property is not set.
* See also: `from`, `order` and `where`.
*/
Expand Down Expand Up @@ -87,6 +87,8 @@

/**
* Parameters passed to the SELECT statement.
* Use the questionmark (?) placeholder within your sql statements for parametrized statements.
* These will be filled with the values from the `params` array.
*/
params: {
value: [],
Expand Down
6 changes: 3 additions & 3 deletions kc-websql-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
},

/**
* The tables version, if newly created
* Latest version of the table schema
*/
version: {
type: String,
value: '1.0'
},

/**
* If newly created, the provided column will become a primary key
* If newly created, the provided column will become the primary key
*/
primaryKey: {
type: String,
Expand All @@ -66,7 +66,7 @@
},

/**
* Creates only a temporary table
* Creates a temporary table.
* Temporary tables don't have version- and migration-support!
* These tables are dropped by the browser as soon as the visitor leaves the page
*/
Expand Down
4 changes: 2 additions & 2 deletions kc-websql-unsupported.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<link rel="import" href="kc-websql.html">

<!--
This polymer element is shown when Web SQL isn't supported by the browser.
It is also shown, if the Promise API isn't supported.
This polymer element is shown when `Web SQL` isn't supported by the browser.
It is also shown, if the `Promise API` isn't supported.
Place any message to show the visitor in case his browser isn't ready to serve the `kc-websql` element in between this tag.
Expand Down
4 changes: 3 additions & 1 deletion kc-websql-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="import" href="kc-websql.html">

<!--
Use this element to update data in a Web Sql database.
Use this element to update data in a `Web Sql` database.
Example:
Expand Down Expand Up @@ -78,6 +78,8 @@

/**
* Parameters passed to the UPDATE statement.
* Use the questionmark (?) placeholder within your sql statements for parametrized statements.
* These will be filled with the values from the `params` array.
*/
params: {
value: [],
Expand Down
7 changes: 3 additions & 4 deletions kc-websql.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@
},

/**
* Starts a new SQLite transaction.
* Returns a promise. Handle all sql statements for the transaction within the promises resolve-method (THEN).
* The transaction will be auto-committed when as soon as the promises resolve-method finishes.
* Starts a new SQLite transaction and returns a promise. Handle all sql statements for the transaction within the resolve-method of the promise (THEN).
* The transaction will be auto-committed as soon as the resolve-method is finished.
* The transaction will be rolled back, if any sql statement fails.
* To manually rollback the transaction, call the collback-method on this element.
* To manually rollback the transaction, call the rollback-method on this element.
*/
transaction: function() {
return kcWebSql.transaction(this.database);
Expand Down

0 comments on commit 50cbc7e

Please sign in to comment.