MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

datacatalog/snippets/quickstart.js:17–169  ·  view source on GitHub ↗
(projectId, datasetId, tableId)

Source from the content-addressed store, hash-verified

15'use strict';
16
17async function main(projectId, datasetId, tableId) {
18 // [START data_catalog_quickstart]
19 // Import the Google Cloud client library and create a client.
20 const {DataCatalogClient} = require('@google-cloud/datacatalog').v1;
21 const datacatalog = new DataCatalogClient();
22
23 async function quickstart() {
24 // Common fields.
25 let request;
26 let responses;
27
28 /**
29 * TODO(developer): Uncomment the following lines before running the sample.
30 */
31 // const projectId = 'my_project'; // Google Cloud Platform project
32 // const datasetId = 'demo_dataset';
33 // const tableId = 'trips';
34
35 // Currently, Data Catalog stores metadata in the
36 // us-central1 region.
37 const location = 'us-central1';
38
39 // Create Fields.
40 const fieldSource = {
41 displayName: 'Source of data asset',
42 type: {
43 primitiveType: 'STRING',
44 },
45 };
46
47 const fieldNumRows = {
48 displayName: 'Number of rows in data asset',
49 type: {
50 primitiveType: 'DOUBLE',
51 },
52 };
53
54 const fieldHasPII = {
55 displayName: 'Has PII',
56 type: {
57 primitiveType: 'BOOL',
58 },
59 };
60
61 const fieldPIIType = {
62 displayName: 'PII type',
63 type: {
64 enumType: {
65 allowedValues: [
66 {
67 displayName: 'EMAIL',
68 },
69 {
70 displayName: 'SOCIAL SECURITY NUMBER',
71 },
72 {
73 displayName: 'NONE',
74 },

Callers 1

quickstart.jsFile · 0.70

Calls 1

quickstartFunction · 0.70

Tested by

no test coverage detected