User-Defined Functions with JavaScript

  • how-to
    +
    How to extend the SQL++ query language by adding your own functions written in JavaScript.

    Introduction

    SQL++ includes a large number of built-in operations and functions that cover every aspect of data manipulation. User-defined functions enable you to create your own extensions to the language.

    Using user-defined functions, you can:

    • Create reuseable, domain-specific functions for use in your applications.

    • Execute complex logic that may be difficult to do in SQL++.

    • Migrate from RDBMS stored procedures.

    User-Defined Functions with JavaScript

    JavaScript supported in Couchbase shares the same constructs of the ECMAScript. However, you should be aware of the restrictions and extensions that come with the Couchbase implementation. These are covered in JavaScript Functions for Query Reference

    Next Steps

    If you’re looking to create your own JavaScript libraries, then there are a number of guides to get you started.

    If you wish to look into the constructs and available in the language itself, then you can have a look through the following pages: